Suppose east.proxy.example and west.proxy.example resolve to the same plain HTTP proxy listener. A client using either name can send:

GET http://www.example.org/report HTTP/1.1
Host: www.example.org

The request identifies the website. It does not carry the proxy alias that the client resolved before opening TCP. Express's Host-derived hostname therefore cannot select a route based on those proxy subdomains.

If you control the client and proxy, provide an explicit routing input. For a proxy implementing an X-Route label:

curl --proxy http://east.proxy.example:8080 \
  --proxy-header 'X-Route: east' \
  https://www.example.org/

--proxy-header targets communication with the proxy, including CONNECT. An ordinary -H header on the HTTPS request belongs inside the destination's encrypted HTTP exchange.

The server must implement and authorize the routing policy, then consume the label without forwarding it to the website. Alternatively, use separately configured listening endpoints or proxy accounts as routing inputs.

For HTTPS destinations, Node receives the initial tunnel request through its HTTP server's connect event. Ordinary Express request middleware does not handle that event. Its CONNECT target still identifies the destination server, not the proxy alias.

Artihkkalat mat laktásit