Skip to content

Protocols

HTTP, HTTPS through CONNECT, and SOCKS5, all on the same host and port. What each one does with TLS and DNS.

The gateway speaks all three common proxy protocols on one host and one port, icn-01.gw.scalardata.ai:7777. It works out which one a connection is using from the first bytes the client sends, so there is nothing to select and no second endpoint to remember.

ProtocolHow it worksAuthenticationNotes
HTTPPlain forward proxy. The client sends the full URL in the request line.Proxy-Authorization header or whitelistFor http:// targets only, one request per connection. The gateway sees the request and response in the clear.
HTTPSCONNECT tunnel. The client opens a TCP tunnel and negotiates TLS with the target through it.Proxy-Authorization header on the CONNECT request, or whitelistFor https:// targets. TLS is end to end; the gateway sees the hostname and byte counts, nothing else.
SOCKS5Generic TCP proxy. Works for any TCP protocol except sending mail: ports 25, 465, 587 and 2525 are refused.Username/password method (RFC 1929) or whitelistCONNECT command only. Use the socks5h scheme so the hostname goes to the gateway, which resolves it, instead of being looked up on your machine.

HTTP

The oldest form. Your client connects to the gateway and sends a request whose target is an absolute URL (GET http://example.com/ HTTP/1.1). The gateway fetches it from the exit IP and relays the response. Because nothing is encrypted, this only applies to http:// targets, which are now rare. One request per connection: the gateway closes the connection after the response, so keep-alive to the gateway does not apply to http:// targets.

curl -x http://icn-01.gw.scalardata.ai:7777 -U "k7f3q2-acme-country-kr:PASSWORD" http://example.com/

HTTPS through CONNECT

For https:// targets the client asks the gateway to open a raw TCP tunnel to host:443 with a CONNECT request, then performs the TLS handshake with the target through that tunnel. The gateway forwards bytes in both directions and cannot read them. There is no certificate to install and no interception: the certificate your client verifies is the target's own.

# The client sends CONNECT example.com:443, then speaks TLS through the tunnel
curl -x http://icn-01.gw.scalardata.ai:7777 -U "k7f3q2-acme-country-kr:PASSWORD" https://example.com/

Note that the proxy URL scheme is still http://. It describes how the client talks to the gateway, not to the target. Most tools pick up that URL from the environment:

export HTTPS_PROXY="http://k7f3q2-acme-country-kr:[email protected]:7777"
export HTTP_PROXY="http://k7f3q2-acme-country-kr:[email protected]:7777"

SOCKS5

SOCKS5 proxies TCP connections without knowing what runs over them, which makes it the option for non-HTTP traffic and for tools that only support SOCKS. Mail ports (25, 465, 587 and 2525) are refused, as on every protocol. Authentication uses the username/password method; the username carries targeting exactly as it does over HTTP. The gateway supports the CONNECT command; BIND and UDP association are not available.

# socks5h: the hostname is sent to the gateway, which resolves and checks it
curl -x socks5h://k7f3q2-acme-country-kr:[email protected]:7777 https://example.com/

# socks5 (no h): your machine resolves the hostname first, then sends the IP

The h matters. With socks5h:// (and its equivalents in other clients, often a "remote DNS" switch) the hostname is sent to the gateway, which resolves it, instead of being looked up on your machine. With plain socks5:// your machine resolves the name locally and leaks the lookup to your own resolver.

Idle connections

An authenticated CONNECT tunnel or SOCKS5 connection stays open for as long as bytes move in either direction. After 10 minutes with no traffic either way, the gateway closes it, and the next request needs a new connection. It also closes it when the traffic it may use runs out (residential balance or the proxy user's monthly cap), when its proxy user, whitelist entry, subscription or IP allocation stops being valid, or when the exit it uses is taken out of service.

TLS notes

  • End to end. Over CONNECT and SOCKS5, TLS runs between your client and the target. The gateway never terminates it and cannot alter the response.
  • Your client's fingerprint. Because your client performs the handshake, the target sees your client's TLS fingerprint (cipher order, extensions, HTTP/2 settings), not the gateway's. Sites that fingerprint TLS react to the client you run, so a browser-grade client on a residential IP behaves like a browser.
  • The hop to the gateway is plaintext. The proxy credentials in the Proxy-Authorization header and the target hostname in the CONNECT line travel unencrypted between your machine and the gateway. On a network you do not control, or if you would rather not send a password at all, use an IP whitelist.
  • Certificate errors are the target's. If your client reports a certificate problem, the certificate came from the destination or from something between the exit IP and it. Retrying on a new IP usually clears a transient case; a persistent one is a property of the site.
  • HTTP/2 and HTTP/3. Inside a CONNECT tunnel your client can negotiate HTTP/2 with the target as usual. HTTP/3 runs over UDP, which the gateway does not carry; clients fall back to HTTP/2 or HTTP/1.1 over TCP.