Open toni-moreno opened 4 years ago
Hello! ,to everybody.
I'm proud to announce a first release working as described before. Here: https://github.com/datadope-io/go-http-tunnel/tree/added_port_auto_assignation
Only tested with tcp connections, this branch is functional to me (working only with tcp ) , but not sure if working with http/sni protocol types.( not tested)
I've configured 2 clients on the same host.
tunnel -id probe-xxx -config ./client1_cfg/tunnel.yml start-all
server_addr: localhost:5223
tunnels:
webdriver:
proto: tcp
addr: localhost:4444
remote_addr: 0.0.0.0:AUTO
git:
proto: tcp
addr: localhost:3000
remote_addr: 0.0.0.0:AUTO
tunnel -id probe-yyy -config client2_cfg/tunnel.yml start-all
server_addr: localhost:5223
tunnels:
webdriver:
proto: tcp
addr: localhost:4444
remote_addr: 0.0.0.0:AUTO
git:
proto: tcp
addr: localhost:3000
remote_addr: 0.0.0.0:3010
tunneld -tlsCrt ./server_cfg/server.crt -tlsKey ./server_cfg/server.key -httpsAddr -httpAddr -tunnelAddr localhost:5223 -portRange 6010:6050 -apiAddr :8080
$ curl localhost:8080/api/clients/list | jq
[
{
"Name": "probe-yyy",
"Source": "127.0.0.1:42958",
"Ports": [
{
"Name": "git",
"LocalAddr": "[::]:3010"
},
{
"Name": "webdriver",
"LocalAddr": "[::]:6010"
}
]
},
{
"Name": "probe-xxx",
"Source": "127.0.0.1:42964",
"Ports": [
{
"Name": "git",
"LocalAddr": "[::]:6011"
},
{
"Name": "webdriver",
"LocalAddr": "[::]:6012"
}
]
}
]
Use case:
This feature request could be useful on cloud environments, where docker images could be created and ended.
In this context.
Supose you have two docker images starting a tunnel client
client 1
With this config.
(executing and adding an -id option)
client 2
(executing and adding an -id option)
Server Side
In the server side once each client is connected , the endpoint should be able to asign as TCP connection endpoint to any free port (from a port range). And add a REST endpoint to check how many connections exist and what IP:PORT shoud use to connect them.
with any HTTP GET client could get this list in json format
With this new feature any ssh/webdriver/XXXX client could connect to any image thougth tunnel server without any client specific config