Skip to content

USAGE.en_US

gwind edited this page Feb 12, 2017 · 2 revisions

otunnel usage

Premise

  1. suppose the server address is example.com
  2. the client can connect to server

Note a single otunnel program can run as server or client.

Simple Usage

run server

./otunnel listen :10000 -s longlongsecret

run client

reverse proxy

e.g:There is a 192.168.1.3:22 in client's local network, we want mapping it on server's port 22.

./otunnel connect example.com:10000 \
    -s longlongsecret -t 'r:192.168.1.3:22::10022'

Now, if we connect example.com:10022, it is equal to connect 192.168.1.3:22 at client side!

forward proxy

e.g: There is a 127.0.0.1:3128 in example.com (server), run command at client:

./otunnel connect example.com:10000 \
    -s longlongsecret -t 'f::20080:127.0.0.1:3128'

Now, any program in client, can access 127.0.0.1:20080, it is equal to access the 127.0.0.1:3128 at example.com (server).

Command Option

-t format

Contain multi components which sperated by : .

ProxyType:LocalAddr:LocalPort:RemoteAddr:RemotePort
Name Desc
ProxyType r is a reverse proxy; f is a forward proxy
LocalAddr IP or domain
LocalPort port number
RemoteAddr IP or domain
RemotePort port numbe

Note

  1. If LocalAddr or RemoteAddr is empty, it means that listen on all interfaces.