client <--> local SOCKS proxy <--> remote VPS (SSH) server

I wants to know , when the client sends a HTTP request (www.youtube.com) ,

and the request reached the VPS server through SOCKS proxy ,

how does the ssh server knows to get the youtube page for client and send back instead just drop it ?

I did NOT do any special configuration on VPS server's sshd_config

I had a lots of search about this , but it seems that all those articles are just talk

about the 'client->proxy->ssh server' part , not the 'ssh server -> outside world' part

  • Are you referring to the SOCKS proxy functionality built into ssh and sshd? Or is there really a "local SOCKS proxy" in this case? – MadHatter Jun 11 '13 at 15:18
  • @MadHatter : what I means is the local SOCKS proxy with ssh -D – ailms Jun 11 '13 at 15:19

It's the code inside sshd that implements SOCKS that is doing the work.

When you run ssh remote.server -D xxx, a local listener is set up on port xxx. Traffic to that local port is transmitted through the ssh tunnel to the SOCKS code in the remote server.

It works because the tunneling functionality is written into the client, and full SOCKS functionality is written into the server, in both cases by the code's authors. There's really not much more to say about it than that.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.