-
Notifications
You must be signed in to change notification settings - Fork 396
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
Host name based access control on the server #387
Comments
Hello, I am not sure to understand your request. or are you talking about the hostname in the requested tunnel. I.e: Regarding DNS resolution, it is the server that does it if you specify a tunnel with a hostname. For example, for the socks5 tunnel, the client forward the host to server, and it is the server that does the DNS resolution. |
Hi @erebe Thank you for the reply, and sorry for the confusion. I meant the hostname of the destination. For example, the
When using I know I can achive In my setup, I configure redsocks to forward traffic on a private interface to the socks5 proxy. DHCP sever is running on the private interface. So it is like a gateway/router. My goal is to let client PCs connected to the private interface to access internet via the socks5 proxy transparently. The client PCs cannot see the socks5 proxy that runs on the gateway/router. For a request like
On the wstunnel server that run command like |
You mean doing reverse IP lookup on the server side to check wether a specific IP belongs to one of the authorised domains? |
Hello @chase-qi, If you are using in curl In general, If you are using socks5, the protocol allows requesting to forward IP address or domain. There is no way for the socks5 server to tell the client to not request forwarding ip address but only domain. The client is free to chose what either suits it best. |
@totchi-lagawi I assumed that the wstunnel client may know domain name for every request that even using @erebe Thanks for you comments. At least I know domain name is not always visible on the server side now. I am closing the ticket. |
Thank you for working on the great project. It is handy and easy to use for me. I have got most of the setup working as I needed. Host name based access control is the last bit. Any comments would be greatly appreciated. Details added below.
Describe the goal
I want to control access on the server side by domain/host name.
wstunnel server is behind nginx proxy. nginx config:
TCP and UDP taffic is forward from iptables to redsocks to wstunnel client socks5 proxy. redsocks config
Describe what does not work
Host-based access only works for server side DNS resolution, but doesn't work for client side DNS resolution. IP-based access control works for client side DNS resolution, but a domain's IP may change which makes it hard to maintain. In this case, I wonder if it is possible at all to see host/domain name on the server side for host based access control.
For my setup, traffic is forwarded from iptables to readsocks, then to wstunnel. I cannot really control how the clients(curl/wget/etc) handles DNS resolution. In my case, Nginx can only see its own domain/host name, not the destination domain/host name. wstunnel server can only see the DNS server IP and destination IP. I think this is mainly because DNS resolution is done on the client side. When using
curl -x socks5h ***
, wstunnel can see destination host name.Describe your wstunnel setup
Server side logs when the client side not using server side DNS resolution.
/wstunnel client -L socks5://127.0.0.1:1080 -P ******** wss://wstunnel.***.***
/usr/local/bin/wstunnel server ws://127.0.0.1:8080 --restrict-config /etc/wstunnel/restrictions.yaml
Desktop (please complete the following information):
Linux
Debian 12
The text was updated successfully, but these errors were encountered: