In today's world, exposing local services to the public internet securely is crucial for developers and system administrators. Whether you're running a personal project, a small business, or even an AI agent, you need a reliable way to create secure tunnels for HTTP, HTTPS, TCP, and UDP services without compromising on security. This is where rustunnel comes in. Built in Rust, rustunnel offers a self-hosted solution that is not only secure and fast but also cost-effective, making it an excellent alternative to services like Ngrok.
What Is rustunnel?
rustunnel is an open-source, self-hosted tunnel server designed to expose local services to the public internet through encrypted WebSocket connections. With features such as TLS termination, HTTP/TCP proxying, and a live dashboard, it allows developers to effortlessly share their local applications while maintaining a high level of security. rustunnel also provides integration with AI agents, making it a versatile tool for various use cases.
Key Features
- Self-Hosted Option: You have complete control over your server and data by self-hosting rustunnel.
- TLS Encryption: All connections are secured with TLS, ensuring your data remains private during transmission.
- WebSocket Support: Expose services over encrypted WebSocket connections, providing a reliable communication channel.
- Multi-Protocol Support: Rustunnel supports HTTP, HTTPS, TCP, and UDP, catering to a wide range of applications.
- Live Dashboard: Monitor your tunnels and connections in real-time with an intuitive dashboard.
- Prometheus Metrics: Integrate with Prometheus for performance monitoring and analytics.
- Audit Logging: Keep track of all tunnel activities for security and compliance.
- MCP Server for AI Agents: Quickly set up a managed option for AI agents, enabling seamless integration.
Installation & Setup
To get started with rustunnel, follow these steps:
# Clone the repository
git clone https://github.com/joaoh82/rustunnel.git
cd rustunnel
# Build the project
cargo build --release
After building the project, you can run the server locally with:
# Run the rustunnel server
./target/release/rustunnel server --config config.toml
Make sure to create a configuration file named config.toml for your server settings. You can refer to the repository for a sample configuration.
How to Use It
Once you have rustunnel up and running, exposing a local service is straightforward. For example, if you want to expose a local web server running on port 8080, you would set up a tunnel like this:
# Expose local service
./target/release/rustunnel tunnel --local-port 8080 --remote-port 80
This command would create a tunnel that allows external access to your local web server through port 80. You can access your service via the public URL provided in the terminal output.
Who Should Use rustunnel?
rustunnel is ideal for developers, system administrators, and anyone who needs to expose local services securely over the internet. It's especially beneficial for:
- Developers testing web applications locally who want to share their work with clients or stakeholders.
- Small businesses needing secure access to internal applications.
- AI developers using MCP servers for seamless integration with their applications.
Final Thoughts
In a landscape filled with various tunneling solutions, rustunnel stands out due to its self-hosted nature, robust security features, and the flexibility it offers through protocol support. The fact that itβs built in Rust ensures high performance and reliability, making it a solid choice for anyone looking to expose local services securely. Whether you're a developer or an organization, rustunnel provides a suitable and economical solution to meet your tunneling needs.