-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
165 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,9 @@ Usage: | |
Options: | ||
-dns-endpoint string | ||
-dns-over-https-enabled | ||
Use DNS-over-HTTPS service as public DNS | ||
-dns-over-https-endpoint string | ||
DNS-over-HTTPS endpoint URL (default "https://dns.google.com/resolve") | ||
-dns-proxy-listen [host]:port | ||
DNS Proxy listen address, as [host]:port (default ":3131") | ||
|
@@ -51,16 +53,18 @@ Options: | |
Log level, one of: debug, info, warn, error, fatal, panic (default "info") | ||
-private-dns string | ||
Private DNS address for no_proxy targets (IP[:port]) | ||
-public-dns string | ||
Public DNS address (IP[:port]) Note: Your proxy needs to support CONNECT method to the Public DNS port, and the public DNS needs to support TCP | ||
-tcp-proxy-dports port1,port2,... | ||
TCP Proxy dports, as port1,port2,... (default "22") | ||
-tcp-proxy-listen [host]:port | ||
TCP Proxy listen address, as [host]:port (default ":3128") | ||
``` | ||
|
||
Proxy configuration is used from standard environment variables, `http_proxy`, `https_proxy` and `no_proxy`. | ||
Also You can use **IP Address**, **CIDR**, **Suffix Domain Name** in `no_proxy`. | ||
Also We can use **IP Address**, **CIDR**, **Suffix Domain Name** in `no_proxy`. | ||
|
||
### Example | ||
### Example | ||
|
||
``` | ||
# Set your proxy environment | ||
|
@@ -70,10 +74,10 @@ export http_proxy=http://foo:[email protected]:3128 | |
export no_proxy=example.org,192.168.0.0/24 | ||
# Start go-transproxy with admin privileges(sudo) | ||
sudo go-transproxy -private-dns 192.168.0.100 | ||
sudo go-transproxy -private-dns 192.168.0.100 -public-dns 8.8.8.8 | ||
``` | ||
|
||
For testing, using docker is easy way. Now, you can access to google from docker container with no proxy configuration as follows. | ||
For testing, using docker is easy way. Now, we can access to google from docker container with no proxy configuration as follows. | ||
|
||
``` | ||
docker run --rm -it centos curl http://www.google.com | ||
|
@@ -85,9 +89,16 @@ The document has moved | |
</BODY></HTML> | ||
``` | ||
|
||
If your proxy doesn't support CONNECT method to DNS port, it cannot resolve public domain name transparently. | ||
Fortunately, Google privides [DNS-over-HTTPS service](https://developers.google.com/speed/public-dns/docs/dns-over-https), so we can use this service as public DNS by adding `-dns-over-https-enabled` option instead of `-public-dns` option as below even if your proxy supports CONNECT method to 443 port only. | ||
|
||
``` | ||
sudo go-transproxy -private-dns 192.168.0.100 -dns-over-https-enabled | ||
``` | ||
|
||
## Current Limitation | ||
|
||
* HTTP proxy: Only works with HTTP host header, e.g., HTTP 1.0. | ||
* HTTP proxy: Only works with HTTP host header. | ||
* HTTPS proxy: `no_proxy` only works with IP Address and CIDR if your https client doesn't support [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication). | ||
* TCP proxy: `no_proxy` only works with IP Address and CIDR. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.