mscdex / socksv5

SOCKS protocol version 5 server and client implementations for node.js
MIT License
400 stars 121 forks source link

Any way to find out our server's address? #13

Closed randunel closed 8 years ago

randunel commented 8 years ago

client -> socks (172.0.0.1) -> destination.example.com

Is there a way to find out which address the client used to connect to the socks server (172.0.0.1)? Or which of the server's IP addresses the connection was made to, when more are available?

ciokan commented 8 years ago

Interested in this as well. Why did you close the issue? :)

mscdex commented 8 years ago

socket.remoteAddress for the client's IP and socket.address().address for the server's IP?

randunel commented 8 years ago

@ciokan I was interested which local ip address was used when bound to 0.0.0.0, but I realized it's not a question for this project. socksv5 uses nodejs sockets and my question is not this project's responsibility, it's a nodejs/sockets question really.

@mscdex socket.address().address returns the bound ip address, according to the documentation. My server has N interfaces, and I'm routing packets based on some complex rules, hence I needed to know which of the interfaces the requests are coming in through.