login about faq

Hi I'm trying to setup a simple SSH Tunnel client software with dynamic port forwarding.

I'm doing it in VB.net

But I'm unable to keep the SSH Tunnel alive, it disconnects as soon as the procedure/function runs, i want to keep it running and use it a browser on my PC as proxy, how can i achieve it ?

I don't want the SSH Tunnel to disconnect till i want to disconnect it

Thanks

asked Aug 09 at 08:08

funtoosh's gravatar image

funtoosh
1112


Well basically it was just my fault

I'm on MAC and using Parallels Desktop for Development, i was testing it using a browser on Mac rather then running a browser inside the VM

link

answered Aug 10 at 11:29

funtoosh's gravatar image

funtoosh
1112

Thanks :) It's good to know how you fixed the problem as someone with a similar issue may stumble upon this thread in the future.

(Aug 10 at 15:44) jpbro ♦

Make sure you're using the latest version of Chilkat..

link

answered Aug 09 at 08:14

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

The SshTunnel can operate in two different ways. The first way is to set a hard-coded destination host:port, such as what is done in the code above.

 m_SSH.DestHostname = m_sTunnelRemoteAddr
 m_SSH.DestPort = m_iTunnelRemotePort

This is reasonable if all communications are directed to a single location, such as a database server.

However, HTTP traffic would need to be directed to many locations. For that, you use SshTunnel in the second way -- with dynamic port forwarding. You don't set DestHostname or DestPort. Instead, you do this:

// Indicate that the background SSH tunnel thread will behave as a SOCKS proxy server // with dynamic port forwarding: tunnel.DynamicPortForwarding = true;

// We may optionally require that connecting clients authenticate with our SOCKS proxy server. // To do this, set an inbound username/password. Any connecting clients would be required to // use SOCKS5 with the correct username/password. // If no inbound username/password is set, then our SOCKS proxy server will accept both // SOCKS4 and SOCKS5 unauthenticated connections.

tunnel.InboundSocksUsername = "chilkat123"; tunnel.InboundSocksPassword = "password123";

See the example here: https://www.example-code.com/vbnet/sshTunnel_dpf.asp

link

answered Aug 09 at 08:48

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Hi I do understand about dynamic port forwarding, i've used exact same code as given in example but the problem is as soon as the procedure/function ends even tunnel stops, i want to keep it running, i just don't understand how to do that

Thanks

link

answered Aug 10 at 10:15

funtoosh's gravatar image

funtoosh
1112

Hera are some logs:

ChilkatLog: BeginAccepting: DllDate: Jun 13 2016 ChilkatVersion: 9.5.0.58 UnlockPrefix: xxxxxx Architecture: Little Endian; 32-bit Language: .NET 4.5 VerboseLogging: 0 listenPort: 1080 dynamicPortForwarding: 1 Listen thread started. AllocatedListenPort: 1080 Success. --BeginAccepting --ChilkatLog

As you can see it connects but then it stops, moreover i'm not closing or stopping tunnel anywhere

link

answered Aug 10 at 10:29

funtoosh's gravatar image

funtoosh
1112

Hi Issue is resolved

Thanks

link

answered Aug 10 at 10:56

funtoosh's gravatar image

funtoosh
1112

How did you resolve the issue?

(Aug 10 at 11:06) jpbro ♦

It had nothing to do with wrong code or Chilkat, it was my fault. I'm on MAC and i'm running VS under Parallels Desktop, i was testing with a browser outside the Parallels Desktop i.e. on MAC, just did not crossed my mind that i'm testing it outside VM

(Aug 12 at 00:45) funtoosh
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:

×90
×14
×13
×6

Asked: Aug 09 at 08:08

Seen: 266 times

Last updated: Aug 12 at 00:45

powered by OSQA