Skip to content

Commit

Permalink
Merge pull request #5 from wadahiro/develop
Browse files Browse the repository at this point in the history
Release v0.3
  • Loading branch information
wadahiro authored Nov 14, 2017
2 parents d2f6714 + 39bc086 commit f4cdb7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ Futheremore, it will configure iptables automatically.
Download from [Releases page](https://github.com/wadahiro/go-transproxy/releases).

### Source install
Use Go 1.8.
Use Go 1.8 and [dep](https://github.com/golang/dep).

```
go get -u github.com/wadahiro/go-transproxy/...
dep ensure
go build -o transproxy cmd/transproxy/main.go
chmod +x transproxy
```

## Usage

```
Usage:
go-transproxy [options]
transproxy [options]
Options:
Expand Down Expand Up @@ -76,7 +78,7 @@ 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 -E go-transproxy -private-dns 192.168.0.100 -public-dns 8.8.8.8
sudo -E 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.
Expand All @@ -95,27 +97,27 @@ If your proxy doesn't support CONNECT method to DNS port, it cannot resolve publ
Fortunately, Google privides [DNS-over-HTTPS service](https://developers.google.com/speed/public-dns/docs/dns-over-https), so you 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 -E go-transproxy -private-dns 192.168.0.100 -dns-over-https-enabled
sudo -E transproxy -private-dns 192.168.0.100 -dns-over-https-enabled
```

If you can resolve all domains directly from local LAN, run command without dns related options as below.
It disables DNS-Proxy.

```
sudo -E go-transproxy
sudo -E transproxy
```

If you need to use both public DNS and private DNS, and need to use public DNS directly, run command with `-dns-over-tcp-disabled` option as below.
It suppresses to insert a iptables OUTPUT rule for DNS over TCP.

```
sudo -E go-transproxy -private-dns 192.168.0.100 -public-dns 172.16.0.1 -dns-over-tcp-disabled
sudo -E transproxy -private-dns 192.168.0.100 -public-dns 172.16.0.1 -dns-over-tcp-disabled
```

If you want to use an application which access to internet using port 5000, run command with `-tcp-proxy-dports` option as below.

```
sudo -E go-transproxy -private-dns 192.168.0.100 -public-dns 8.8.8.8 -tcp-proxy-dports 22,5000
sudo -E transproxy -private-dns 192.168.0.100 -public-dns 8.8.8.8 -tcp-proxy-dports 22,5000
```

## Current Limitation
Expand Down
12 changes: 12 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

VERSION=0.3

DIR=$(cd $(dirname $0); pwd)
cd $DIR

rm -rf bin/*
go build -v -o bin/transproxy -a -tags netgo -installsuffix netgo cmd/transproxy/main.go

tar cvzf go-transproxy-$VERSION.tar.gz bin README.md LICENSE

0 comments on commit f4cdb7f

Please sign in to comment.