TCP Port Mapper in Proxy mode: how redirect all traffic to the specified host:port.

by Vitaly, Friday, July 31st, 2015

When TCP Port Mapper (tcpportmap) acts as a proxy (ProxyMode has one of the values: HTTP, CONNECT, SOCKS4 or SOCKS5), then MapToHost and MapToPort can be used to forward all traffic to the specifed host:port.

For example, let ProxyMode=CONNECT and TCP Port Mapper has received this command from the client:

CONNECT www.google.com:80 HTTP/1.1
  1. If MapToHost=127.0.0.1, MapToPort=8080 then TCP Port Mapper will establish connection to 127.0.0.1:8080.
  2. If MapToHost=127.0.0.1, MapToPort is not specified (or zero) then TCP Port Mapper will establish connection to 127.0.0.1:80.
  3. If MapToHost is not specified (or empty), MapToPort=8080 then TCP Port Mapper will establish connection to www.google.com:8080.
  4. If the both MapToHost and MapToPort are not specified then TCP Port Mapper will establish connection to www.google.com:80.

Tags: ,