2

Closed

Proxy server support

description

Added this item here, I would be interested in tinkering with the project adding this feature.

But before I do, I would like to know where you believe I should do my work, since you know the source code better than I at the moment.

It looks like the code handling proxy server negotiation and authentication should be in Session.cs - Connect().
Receiving response from the proxy server should be put in Session:cs ReceiveMessage(), and replying put in Session.cs SendMessage(Message).

Then adding code for SOCKS proxies (which is the first I will attempt to create), which is based in an interface for all common proxies.

As alot of the code is wrapped around the SSH messages (which I'm not familiar with), I need your help to determine where code changes should be made.

No files are attached

Closed Jan 4 at 1:58 PM by olegkap

Added support in 13433.


comments

olegkap wrote Jan 4 at 1:57 PM

All,

Please take a look at 13433 changeset where I added proxy support and let me know what you think.

Thanks,
Oleg

olegkap wrote Jan 3 at 2:09 PM

Hi Scott,

Thanks for describing your scenario,

I will try to implement something as soon as I can, at least SOCKS4 protocol, which I already know how it works.

Thanks,
Oleg

skotl wrote Jan 2 at 11:19 PM

Hi Oleg

in our office, the firewall explicitly forbids outgoing access for all protocols (HTTP, FTP, SFTP, SSH, etc) unless the connection comes from the proxy server. This is so that we can a) report on who/what/where is using the Internet and b) throttle/prioritise traffic based on destination and protocol.

So, literally all Internet traffic needs to go through the proxy server.

One of our internal apps allows our support staff to SFTP large files up to a "bucket server" on the Internet. Currently, it creates a command line for Putty and then passes the upload over to Putty.exe, which is able to use the proxy.
One of the drawbacks with this is that the operator cannot see any progress (%) indicator to let them know when it will be complete.

This is a great candidate for us to drop ssh.net into the app and take advantage of its async progress reporting, however it would need to be configurable to go via the proxy server.

Cheers
Scott

LonelyPixel wrote Aug 6 2011 at 7:54 PM

You can always need HTTP proxy support when you're behind a firewall that won't let you connect directly to remote hosts. You probably still need an SSH server listening on port 443 though. I'm also interested in this feature but I've just found this project and am now proceeding to download it and take a look at it. (I've been disappointed by SharpSSH's implementation and that it's dead by now. But for a first test it worked.)

olegkap wrote May 13 2011 at 3:49 PM

From what I could find about it, it looks to me that the best way to approach it is similar to port forwarding feature, cause it in sence what it is.
I didnt see how the it needs to be done on protocol level but as far as implemention goes
I would create a new class called SshProxy and start my implemention there.
Then if you need to open a channel and perform some operaions there, then you just need to open approriate channel and then send either request or data to it, and receive data from it.
I would start looking into ForwardedPortLocal and ForwardedPortRemote classes as an example.

Hope it helps.

If you like we should probably make it as a new discussion thread, would be much easier to exchange info there.

Thanks,
Oleg

Kenneth_aa wrote May 12 2011 at 8:17 AM

It is not a current issue for me, but it's noteworthy that most SSH clients supports some kind of proxy. Putty supports several, and WinSCP equals that. Therefore I would like to get to know the [SSH.Net] code better by adding a feature.

olegkap wrote May 11 2011 at 4:43 PM

Hey,

Can you describe a scenario where yo would need a proxy client support?
Like where you would like it to work and it doesn't ?

Thanks,
Oleg