diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b7d9ace --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Hiroyuki Wada + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cfefb94 --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +# go-tproxy + +Transparent proxy servers for HTTP, HTTPS, DNS and TCP. +This repository is heavily under development. + +## Description + +**go-tproxy** provides transparent proxy servers for HTTP, HTTPS, DNS and TCP with single binary. +Nothing needs to setup many tools. Nothing needs to configure iptables. +**go-tproxy** will start multiple proxy servers for these protocols. +Futheremore, it will configure iptables automatically. + +## Requirement + +**go-tproxy** supports only Linux iptables. + +## Install + +### Binaly install +Download from [Releases page](https://github.com/wadahiro/go-tproxy/releases). + +### Source install +Use Go 1.8. + +``` +go get -u github.com/wadahiro/go-tproxy/... +``` + +## Usage + +``` +Usage: + + go-tproxy [options] + +Options: + + -dns-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") + -dns-tcp + DNS Listen on TCP (default true) + -dns-udp + DNS Listen on UDP (default true) + -http-proxy-listen [host]:port + HTTP Proxy listen address, as [host]:port (default ":3129") + -https-proxy-listen [host]:port + HTTPS Proxy listen address, as [host]:port (default ":3130") + -loglevel string + Log level, one of: debug, info, warn, error, fatal, panic (default "info") + -private-dns string + Private DNS address for no_proxy targets (IP[:port]) + -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`. + +### Example + +``` +# Set your proxy environment +export http_proxy=http://foo:bar@yourproxy.example.org:3128 + +# Set no_proxy if you need to access directly for internal +export no_proxy=example.org,192.168.0.0/24 + +# Start go-tproxy with admin privileges(sudo) +sudo go-tproxy -private-dns 192.168.0.100 +``` + +For testing, using docker is easy way. Now, you can access to google from docker container with no proxy configuration as follows. + +``` +docker run --rm -it centos curl http://www.google.com +
+