How do you proxy though a server using ssh (socks…) using php’s CURL?

后端 未结 5 883
梦谈多话
梦谈多话 2021-02-10 00:27

I want to use ssh, something like this:

ssh -D 9999 username@ip-address-of-ssh-server

But within php CURL, but I don\'t really see how this cou

5条回答
  •  感动是毒
    2021-02-10 00:53

    according to manpage the -D does create a socks proxy.

    -D [bind_address:]port
                 Specifies a local ``dynamic'' application-level port forwarding.
                 This works by allocating a socket to listen to port on the local
                 side, optionally bound to the specified bind_address.  Whenever a
                 connection is made to this port, the connection is forwarded over
                 the secure channel, and the application protocol is then used to
                 determine where to connect to from the remote machine.  Currently
                 the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
                 as a SOCKS server.  Only root can forward privileged ports.  Dy-
                 namic port forwardings can also be specified in the configuration
                 file.
    

提交回复
热议问题