Skip to content

SOCKS5 proxy

Dynamic forwarding creates a SOCKS5 proxy on your device that routes traffic through the SSH connection. Instead of forwarding one port to one destination, the proxy handles any destination on the fly: each program that connects tells the proxy where it wants to go, and the proxy opens that connection through SSH.

The SOCKS5 proxy is free on every plan.

Equivalent SSH command: ssh -D [bind_address:]port user@server


  • Browsing a private network. Your SSH server sits on a company or home network. You want several web UIs and admin panels there without a separate local forward for each one. Point your browser at the SOCKS5 proxy and open private addresses directly.
  • Untrusted Wi-Fi. On a café or hotel network, routing your browser through a server you trust keeps the traffic encrypted between your device and that server.
  • Network restrictions. Your current network blocks certain ports. Traffic through the SSH tunnel leaves from the server instead.
  • Seeing a region. Your SSH server is in another region. Routing through it shows how services answer traffic from there.

ZestSSH’s SOCKS5 proxy follows RFC 1928 (SOCKS Protocol Version 5). When you start a dynamic forward:

  1. A TCP listener opens on your device at the address and port you set (usually 127.0.0.1:1080).
  2. Programs connect to this port and do the SOCKS5 handshake.
  3. The proxy uses no authentication, which is why it should listen only on your own device.
  4. The program sends a CONNECT request with the destination address and port.
  5. ZestSSH opens a direct-tcpip SSH channel to that destination through the SSH connection.
  6. Data is relayed both ways between the program and the SSH channel.

The proxy accepts three address types:

  • IPv4 addresses
  • Domain names (resolved by the SSH server, not by your device)
  • IPv6 addresses

Because the server resolves names, those DNS lookups do not go out on your local network.

When a connection cannot be made, the program is told why in the SOCKS5 reply (for example, the host is unreachable). A notice “(name): connections are not getting through” appears only when the server passes no connections on at all, for example because forwarding is turned off there.


  1. Connect to your server and tap the Port forward button (two arrows) in the session toolbar.
  2. Tap Add, then either tap the SOCKS preset (it selects SOCKS5, names it “SOCKS proxy” and fills in port 1080) or select SOCKS5 yourself.
  3. Set the SOCKS5 port. The field starts empty with 1080 as a hint, so type a port if you did not use the preset. This is the port your programs connect to.
  4. Bind address starts at 127.0.0.1. Only change it if other devices on your network should use the proxy.
  5. Tap Add, then start it with the play button.

While the proxy runs, its line on this screen shows how many connections are open and how much data has passed, for example “SOCKS5 proxy • 3 conn(s) • 1.2 MB”.

  1. In the side rail, under Manage, click Port forwarding, then New rule.
  2. In Simple mode, under What do you want to do?, pick Browse through the server (“A SOCKS5 proxy, like a lightweight VPN”).
  3. Set Name, the Server and Port here (for example 1080). Simple mode listens on this device only; Let other machines reach it opens it to other devices on your network, after you allow it. In Advanced mode, with Type Dynamic (-D), the host under Source sets the address.
  4. Click Save, then Start, or Save and start.

The tunnel picture says what it does: “While it runs, apps on this device set to the SOCKS5 proxy localhost:1080 go out through web-01.” In the list, its rule shows SOCKS5 on localhost:1080.


  1. Open Settings and search for “proxy”.
  2. Click Settings under Network Settings.
  3. Select Manual proxy configuration.
  4. Leave the HTTP and HTTPS proxy fields empty.
  5. Set SOCKS Host to 127.0.0.1 and Port to 1080 (or the port you chose).
  6. Select SOCKS v5.
  7. Check Proxy DNS when using SOCKS v5 so that DNS lookups go through the tunnel too.
  8. Click OK.

Chrome and Edge use the system proxy settings:

  • Windows: open Settings, search “proxy”, and set a manual SOCKS5 proxy at 127.0.0.1:1080.
  • macOS: System Settings, Network, your network’s Details, Proxies, then turn on SOCKS proxy at 127.0.0.1:1080.
  • Linux: set the proxy in your desktop’s network settings (GNOME or KDE), or with environment variables.

You can also use a browser extension that sets a SOCKS5 proxy per profile without changing the system settings.

Any program that supports SOCKS5 can use the tunnel. Common examples:

  • curl: curl --socks5-hostname 127.0.0.1:1080 http://intranet.example.com/
  • Git: git config http.proxy socks5://127.0.0.1:1080
  • Python requests: proxies = {'http': 'socks5h://127.0.0.1:1080', 'https': 'socks5h://127.0.0.1:1080'}

Use socks5h:// (with the h) to have the proxy resolve host names on the server side.


  • Latency: every request adds a round trip through the SSH connection. For browsing this is usually small, but slow or long-distance links are noticeable.
  • Throughput: SSH encryption costs some CPU. Large downloads may be somewhat slower than a direct connection. The proxy reads from each side only as fast as the other side takes the data, so a slow reader does not fill your device’s memory.
  • Connection count: each proxied connection opens an SSH channel. One proxy accepts at most 128 connections at once; more are refused until some close. Browsers can open many at once, so a busy page may need a moment.
  • DNS: with server-side name resolution, names may resolve differently than they would on your local network. This is usually what you want, but worth knowing.

  • SOCKS5 here carries TCP only. UDP-based protocols (most VoIP, some games, DNS over UDP) are not tunneled.
  • The proxy handles only the CONNECT command. BIND and UDP ASSOCIATE are refused.
  • On iOS, the proxy has the same background limits as other port forwards: iOS ends it while ZestSSH is in the background.
  • This proxy is one that ZestSSH provides to other programs on your device. ZestSSH cannot itself connect out through a SOCKS or HTTP proxy, and there is no ProxyCommand setting: to reach a host through an intermediate machine, use a jump host (Connect via). See the Limitations section of the SSH page.