TCP endpoint

TCP endpoint is a listener for TCP traffic. When this endpoint is started, it will listen to the client connections on a specified port range. When a client connects to a specific port, server will look for a conected tunnel on that port and if there is such a tunnel it will create a link between them and route data.

Configuration is setup as follows:

{
    "server":{
        // ...other fields
        "endpoints":{
            "tcp": {
                "type": "tcp",
                "address": null,
                "allow_desired_port": true,
                "reserve_ports_from": 4000,
                "reserve_ports_to": 4050,
                "encryption": {
                    "type": "none"
                },
                "full_hostname_template": "localhost:{port}"
            }
        }
    }
    
}

Fields:

KeyDescriptionDefault Value
typeThe type of the endpoint, in this case, always TCP.No default
addressThe address to bind to.0.0.0.0
allow_desired_portAllows the use of a desired port if available. If not available, first available port will be chosen.true
reserve_ports_fromThe starting port of the reserved range for this endpoint.No default
reserve_ports_toThe ending port of the reserved range range for this endpoint.No default
encryptionThe type of TLS encryption used. See configuring encryption.No encryption
full_hostname_templateTemplate for the full hostname with port. See configuring templates below.No default

Configuring templates

For TCP endpoints you can set templates to define how an URL will will be generated for a tunnel. There are two templates you can set:

{
    "server":{
        // ...other fields
        "endpoints":{
            "tcp": {
                 // ...other fields
                "full_hostname_template": "localhost:{port}"
            }
        }
    }
    
}

Template you set here, will be returned by the server to the tunnel proxying the connection, to tell the user where their local server can be reached from.

Placeholder {port} will be replaced by the port assigned to the tunnel.