I want to use rebex to creat a SSH port forwarding capabilitie applicatication like as tunnelier. who can help me ?

asked 25 Jan '10, 10:17

user-12%20%28google%29's gravatar image

user-12 (goo...
161
accept rate: 0%

edited 26 Feb '10, 15:09

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18


The SSH functionality required to make this possible is already included in both Rebex SFTP and Rebex SSH Shell and can be used to implement a Tunnelier-like application, but we have yet to add a simple API to make this easy. This is planned for one of the future releases.

If you don't want to wait, download our SshTunnel sample application (C# and VB.NET) and give it a try - it uses the current version of Rebex SFTP or SSH Shell to tunnel connections from the specified local port through the specified SSH server to the specified target IP address and port.

The application forwards all traffic from the IP/port in the "Local" field (127.0.0.1:8080 by default) to IP/port in the "Remote" field (209.85.129.99:80 by default). The default tunnelling setting tunnels connections to port 8080 to port 80 of google.com, making it possible to connect to Google through the specified SSH server by typing http://localhost:8080/ in the local web browser. Replacing Google's IP/port (209.85.129.99) will make it tunnel to a different address.

C# and VB.NET source code is included with the sample application. The two classes in Tunnel.cs are the sample core. Any feedback is welcome!

link

answered 25 Jan '10, 14:03

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

edited 25 Jan '10, 17:53

Thanks for your reply. That's mean i only possible to connect to a server (not a hosting) ? Then, it's so hard. Have any way to connect to a any website through the ssh server ?

Thanks

(26 Jan '10, 05:03) user-12 (goo...

Well, you CAN specify a hostname instead of IP address, but that won't make it possible to "connect to any website" from your web browser. To do that, you would have to add a HTTP or Socks proxy server to accept incoming connections (from a web browser) and tunnel them through an SSH server (which is what the SshTunnel sample does). We don't offer any proxy server implementation at the moment (only proxy clients), so you would have to write that yourself. What are you actually trying to achieve? Perhaps a third-party application like Bitvise Tunnelier might be more suitable for your needs?

(26 Jan '10, 14:45) Lukas Pokorny ♦♦

Yes. That's all i need. Can you give a sample ?

(27 Jan '10, 08:48) user-12 (goo...

What sample? It looks like you are interested in a general-purpose Tunnelier-like application. I tried to explain that a HTTP or Socks proxy server functionality would be needed for this and that we DON'T currently have such component (or sample code). Sorry!

(27 Jan '10, 14:14) Lukas Pokorny ♦♦

Then, if i have a Socks proxy, how can i do that with sshtunnel sample ?

(27 Jan '10, 14:45) user-12 (goo...

I am affraid I don't quite understand your question.

If you already have a Socks4/Socks5 server code, enhance it to take advantage of the OutgoingTunnel class (from the sample above) to be able to tunnel through SSH. We don't have any Socks4/Socks5 server code yet, so I'm unable to provide any sample for that, unfortunately.

(28 Jan '10, 15:18) Lukas Pokorny ♦♦

Sorry but i'm still can't understand how can i do that. I already have Socks 5 sever code, can you let me know how can i edit Outgoingtunnel class to be able to tunnel through SSH ? Thanks :)

(29 Jan '10, 05:07) user-12 (goo...

If you already have Socks 5 server code, then there is a place in your code where you have a Socket (connected client) and a remote hostname (or IP address)/port you need to tunnel it to. Normally, you would now open a new Socket to the remote address. But instead, use SshSession object's OpenTcpIpTunnel (like the sample app) to open an SSH tunnel and then use Tunnel.StartTunnelling (from the sample app) to forward data between the Socket (connected client) and the SshChannel (SSH tunnel). I can't be more specific because I don't have access to your Socks5 server code.

(29 Jan '10, 07:28) Lukas Pokorny ♦♦

Can you give a vb.net source with a example socks5 server code ?

(29 Jan '10, 13:29) user-12 (goo...

Sorry, we don't have any example Socks5 server code.

(31 Jan '10, 19:58) Lukas Pokorny ♦♦

Is it like this: 67.78.543.2:2040 ?

(01 Feb '10, 04:55) user-12 (goo...

I don't understand this question. What does "it" mean? Also, 67.78.543.2 is not even a valid IP address.

(01 Feb '10, 10:14) Lukas Pokorny ♦♦

How does socks5 server code form?

(02 Feb '10, 08:16) user-12 (goo...

I am sorry, but I don't understand the last question either. I asked one of my colleagues to send you an e-mail and try to explain what we can offer and what we can't. Sorry for inconvenience!

(03 Feb '10, 11:25) Lukas Pokorny ♦♦
showing 5 of 14 show 9 more comments

I only can access to google page when use it. How can i access to another page such as whatismyip.com or microsoft.com with it ?

I like VB.NET code, can you give me it ? tks

link

answered 25 Jan '10, 14:36

user-12%20%28google%29's gravatar image

user-12 (goo...
161
accept rate: 0%

I edited my original answer to include a link to a ZIP file with both C# and VB.NET version, please download it again.

I also added more thorough description of what it actually does. To tunnel to a different website, use another IP address instead of 209.85.129.99, but it has to be a website that actually runs at that IP address (unlike google.com, microsoft.com does listen at 207.46.192.254, but redirects the browser to a hostname-based address).

If you have more questions, please add your comments to my original reply.

(25 Jan '10, 17:56) Lukas Pokorny ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×39
×2

Asked: 25 Jan '10, 10:17

Seen: 1,272 times

Last updated: 26 Feb '10, 15:09