DEV Community

Sem Jajo
Sem Jajo

Posted on • Edited on

Building GRIQ: expose your localhost to the internet

Introduction

Hey everyone! ๐Ÿ‘‹ I'm excited to share GRIQ. Inspired by tools like ngrok and jprq, I thought, why not reinvent the wheel? After all, if you donโ€™t build the wheel, youโ€™ll never learn how to make cars, right? ๐Ÿ˜„

This journey was both challenging and super fun, and in this blog post, I'll walk you through what GRIQ is, how it works, and whatโ€™s next.

What is GRIQ?

GRIQ is a lightweight HTTP tunneling service that allows you to expose your local servers to the internet through secure tunnels. It provides a simple and reliable way to create public URLs for your local servers without complex network configurations.

Why Build GRIQ?

Sure, ngrok and jprq are amazing tools that already exist. But building GRIQ from scratch taught me a lot about HTTP tunneling, WebSocket handling, CLI creation, and backend architecture. Plus, making it open-source felt like a good way to give back to the community and let others learn from my journey.

Features

๐Ÿš€ Expose local servers to the internet instantly

๐Ÿ”€ Custom subdomains for better branding

๐Ÿ“ Static file serving built-in

๐Ÿ”„ Automatic reconnection for reliable connections

๐Ÿ’ป User-friendly CLI with real-time status updates

๐ŸŒ WebSocket support for real-time communication

โšก Lightweight client with minimal dependencies

Installation

Setting up GRIQ is super easy. You can install it with a single command:

curl -fsSL https://griq.site/install.sh | bash

Once installed, you can expose your local application by running:

griq http 3000 # Expose localhost:3000

You'll get a public URL like:

http://[random-subdomain].griq.site

Roadmap

Here are some features planned for future releases:

โœ… User authentication and authorization

โœ… HTTPS support

โœ… Custom domain mapping

โœ… Request/response logging

โœ… Rate limiting

โœ… API for programmatic access

Security Notice

โš ๏ธ GRIQ does not include authentication yet. It will be added in future updates to ensure secure tunneling.

Contributing

Contributions are always welcome! Feel free to submit a pull request if you'd like to contribute to GRIQ's development.

Check it out on GitHub!

The entire project is open-source. You can find the code here: [https://github.com/sem22-dev/griq]

Conclusion

Building GRIQ from scratch has been an incredible learning experience. Re-inventing the wheel is sometimes necessary to understand how cars are made. Iโ€™m excited to keep improving it and hope others can learn from it, too.

Feel free to contribute, suggest improvements, or just try it out and let me know what you think. Stay tuned for more updates! ๐Ÿ˜Š

Happy Tunneling! ๐ŸŒ

Top comments (0)