User Tools

Site Tools


tcptunneling

TCP tunneling

Peer can specify allowed tcp ports he intends to share with other peers in the configuration file. Once peers are listed with list command, available TCP ports are shown. To establish a tunnel, peer invokes tunnel add command. If everything goes well, tunnel is established successfully. Tunnels can be displayed using dump command.

Example

List peers, retrieve a pubkeyhash and open one of the available ports:

> peers
{
  "peers":[
    {
      "host":"32aa812",
      "port":64948,
      "type":2,
      "unreachable":0,
      "authed":0,
      "pubkeyhash":"791439f16f86b8bc5511ebeb59a39a071cbeb8be5a4f8b856257c7e9020de615",
      "tcpdescription":"22 - ssh",
      "ports":[
        22
      ]
    }
  ]
}

Open a tunnel:

> ua 791439f16f86b8bc5511ebeb59a39a071cbeb8be5a4f8b856257c7e9020de615 22
{
  "success":true
}

List available tunnels:

> ud
{
  "tunnels":[
    {
      "host":"32aa812",
      "port":64948,
      "pubkeyhash":"791439f16f86b8bc5511ebeb59a39a071cbeb8be5a4f8b856257c7e9020de615",
      "src_port":51841,
      "dst_port":22,
      "clients":0
    }
  ],
  "count":1
}

At this point, localhost:51841 is available and all requests are redirected to remote peer's port 22.

tcptunneling.txt · Last modified: 2020/01/20 01:05 by xor