3

I'm searching for a class / extension / whatever that allows me to use a proxy for an SFTP connection in PHP.

I've checked the ssh2_ftp function and phpseclib, but I didn't find any reference to proxy settings...

Any idea?

Barry
  • 3,303
  • 7
  • 23
  • 42
napolux
  • 15,574
  • 9
  • 51
  • 70

2 Answers2

1

Would you be tunneling over SOCK4 or SOCK5 or HTTP CONNECT? Or something else?

One thing you might be able to do is modify phpseclib. eg. in the Net_SSH2 constructor, add in the code to connect to the proxy via SOCK4/5/whatever and then just let Net_SSH2 behave normally after that.

neubert
  • 15,947
  • 24
  • 120
  • 212
  • I was considering changing the library itself, but before doing that I'm searching for a "ready-made" solution. Thanks anyway. :-) – napolux Jul 24 '13 at 07:49
0

I have had no problem with using https://github.com/phpseclib/phpseclib and would recommend this method. It also requires no installation on the server and is very easy to achieve most SFTP actions required.

Barry
  • 3,303
  • 7
  • 23
  • 42
  • In case anyone is new to this (like myself), [this is phpseclib](https://github.com/phpseclib/phpseclib). – Uwe Keim Mar 14 '23 at 06:59