How Do I Handle TCP Traffic?
TCP endpoints enable you to deliver any network service with a TCP-based protocol. They are commonly used to create connectivity for:
- Remote access protocols like SSH, VNC and RDP
- Databases like MySQL, Postgres, MSSQL and SQLite
- IoT protocols like MQTT
- Gaming servers like Minecraft
If you are accepting TLS traffic, consider using a TLS Endpoint.
TCP endpoints are only available on a free plan after adding a valid payment method to your account.
Quickstart
Agent Endpoints are the easiest way to get started with ngrok. An agent endpoint is started by a Secure Tunnels agent. The endpoint lives for the lifetime of the process and forwards traffic to a port or URL of your choosing.
This example creates a TCP endpoint on a randomly-assigned URL - e.g.
tcp://1.tcp.ngrok.io:12345
and forwards its traffic to a local port.
Loading…
Learn more
- URL Validation — URLs are validated differently depending on their binding. To learn more about valid URLs for TCP endpoints, see the Endpoint URLs documentation.
- Static URLs — To create a public TCP endpoint with a static URL, you must first create a TCP Address. See the documentation on static TCP URLs for more information.
- Authentication — You can secure your TCP endpoints with the IP Restriction and Mutual TLS Traffic Policy actions. There is a limited set of actions available to authenticate TCP traffic because the protocol is low-level.
- Bring your own domain — To use your own domain with TCP endpoints, see the guide on the subject.
- Traffic Observability — Traffic Inspector gives you a real-time view in the ngrok dashboard of the traffic flowing through your TLS endpoints. You can even export traffic logs with the Traffic Events system.
Errors
Learn how ngrok handles errors for TCP endpoints in the Errors documentation.
API
TCP Endpoints can be created programatically. Consult the documentation on Endpoint APIs.
Limits & pricing
TCP endpoints are available on all plans. To access them on the free plan, add a payment method to your ngrok account. Consult the pricing documentation for general billing details.
For TCP limits, see the endpoint Limits documentation.
See TCP Addresses pricing for details on pricing for fixed TCP Addresses.