The httpHostOverride
is exactly what you need.
Please note that the httpHostOverride
option is valid only for HTTP communication, so you have to also set protocol
to HTTP
or HTTPS
depending on your needs.
See tlsproxy tunnel add -?
:
--http-host-override <name>
Modifies HTTP traffic by including/overwriting the Host request header. Optional.
Only applies when protocol is HTTP capable.
Sample config:
tunnels:
- name: httpbin.org
in: { port: 8080, protocol: HTTP }
out: { address: httpbin.org, port: 443, protocol: HTTPS }
httpHostOverride: mydomain.com
Note:
The httpHostOverride
only affects the content of the Host
HTTP request header. The browser will still think it is connected to a localhost
server. In the provided sample (httpbin service), you will see the [ Base URL: localhost:8080/ ]
still refers to localhost
, but if you execute query for HTTP Methods / GET the response will show "Host": "mydomain.com"
.
To convince the browser about "correct" host, you can update your hosts
file (typically located at C:\Windows\System32\drivers\etc\hosts
) and route your desired domain to 127.0.0.1
IP address. Then type your desired domain into the browser's address bar instead of localhost
.