GOST 2.1 Local Port Forwarding¶
Original post: https://groups.google.com/g/go-gost/c/_Bn0oDKants.
The 2.1 version is under development, with the main addition being port forwarding. This post covers local port forwarding.
GOST's local port forwarding is similar to SSH's -L option. The key differences are:
- GOST supports UDP port forwarding.
- GOST supports port forwarding through a forwarding chain.
Assume three machines: local_host, proxy_host, remote_host
local_hostis our local machine, which can accessproxy_hostbut cannot directly accessremote_host.proxy_hostis the proxy host, which can access bothlocal_hostandremote_host.remote_hostis a remote host reachable fromproxy_host.
local_host <-> proxy_host <-> remote_host
TCP Port Forwarding¶
To SSH from local_host to remote_host (port 22) using local port forwarding:
This assumes proxy_host has an HTTP proxy listening on port 8080.
Then on local_host:
This connects to remote_host.
UDP Port Forwarding¶
Same scenario, but now we want to access the UDP 53 (DNS) service on remote_host:
This assumes proxy_host has a GOST SOCKS5 proxy listening on port 1080.
Then on local_host:
This queries remote_host's UDP 53 port.
Note: UDP port forwarding uses UDP-over-TCP, so the last hop (the final -F parameter) must be a GOST SOCKS5 type.