Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: tunnels #102

Closed
honwen opened this issue Nov 11, 2017 · 15 comments
Closed

Feature request: tunnels #102

honwen opened this issue Nov 11, 2017 · 15 comments

Comments

@honwen
Copy link

honwen commented Nov 11, 2017

Describe actual behavior

NULL

What is your expected behavior

tunnels both UDP and TCP
Example: https://github.com/shadowsocks/go-shadowsocks2

Client

Start a client connecting to the above server. The client listens on port 1080 for incoming SOCKS5
connections, and tunnels both UDP and TCP on port 8053 and port 8054 to 8.8.8.8:53 and 8.8.4.4:53
respectively.

go-shadowsocks2 -c ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488 \
    -verbose -socks :1080 -udptun :8053=8.8.8.8:53,:8054=8.8.4.4:53 \
                          -tcptun :8053=8.8.8.8:53,:8054=8.8.4.4:53

Specifications like the version of the project, operating system, or hardware

Ver: 714df2f

Steps to deploy the server

Steps to reproduce the problem

@txthinking
Copy link
Owner

txthinking commented Nov 12, 2017 via email

@honwen
Copy link
Author

honwen commented Nov 12, 2017

Not every program we need support proxy.

For example, DNS over brook, openvpn over brook, and even rdp(remote desktop of Windows ) over brook.

@txthinking
Copy link
Owner

txthinking commented Nov 13, 2017 via email

@txthinking
Copy link
Owner

txthinking commented Nov 13, 2017 via email

@honwen
Copy link
Author

honwen commented Nov 13, 2017

Yes, that's what I am talking about.

@jusss
Copy link

jusss commented Jan 11, 2018

sorry to bother, I'd like to make brook as global proxy, like a vpn, I know how to use iptables to and
redsocks to redirect TCP datum to the port brook listen on, but I don't know how to solve the dns issue,
for example brook listen on 127.0.0.1:7070, so I should redirect the dns datum to local UDP port 7070?
or TCP port 7070?

@txthinking
Copy link
Owner

txthinking commented Jan 11, 2018 via email

@txthinking
Copy link
Owner

If you has a brook server $ brook server ...
and you want start tunnel to 8.8.8.8:53
then you can create a DNS server with Brook:

$ brook tunnel -l 127.0.0.1:53 -t 8.8.8.8:53 -s your_server:port -p password

Test it:
$ dig google.com @127.0.0.1
$ dig +tcp google.com @127.0.0.1

Sure, tunnel can work with more, not only DNS.

Clouds-MacBook-Pro:brook tx$ brook tunnel -h
NAME:
   brook tunnel - Run as tunnel mode

USAGE:
   brook tunnel [command options] [arguments...]

OPTIONS:
   --listen value, -l value    Client listen address, like: 127.0.0.1:1080
   --to value, -t value        Tunnel to where, like: 8.8.8.8:53
   --server value, -s value    Server address, like: 1.2.3.4:1080
   --password value, -p value  Server password
   --tcpTimeout value          connection tcp keepalive timeout (s) (default: 60)
   --tcpDeadline value         connection deadline time (s) (default: 0)
   --udpDeadline value         connection deadline time (s) (default: 60)

@honwen
Copy link
Author

honwen commented Jan 13, 2018

Thanks a lot. It works very well.

@jusss
Copy link

jusss commented Jan 14, 2018

could you write more specifically?
run brook server ... on the server and run brook tunnel ... on the client?
or run brook tunnel ... and brook server ... both on the server and run them both on the client?
thanks for your reply!

@jusss
Copy link

jusss commented Jan 14, 2018

also if brook tunnel ... supports transparent proxy, that means I can redirect all tcp datum to the port which brook listen on directly, and without redsocks for socks5 wrap? is that right?

@txthinking
Copy link
Owner

@jusss No, it's not transparent proxy #117 .

@txthinking
Copy link
Owner

@jusss If redsocks can support UDP. You can try with your idea: #102 (comment)

@x0r2d2
Copy link

x0r2d2 commented Feb 3, 2018

@txthinking Didn't understand the usage of tunnel. It is used with "server" or separately?
Thanks.

@jusss
Copy link

jusss commented Feb 5, 2018

@hybtoy the tunnel only works with brook server
you run brook server on your VPS, then you can run brook tunnel on your local,
and it seems you must point the destination address if you want to use brook tunnel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants