# Need help with tunnel connection issue in net-ssh

**URL:** <https://www.ruby-forum.com/t/need-help-with-tunnel-connection-issue-in-net-ssh/179567>\
**Category:** Ruby\
**Created:** [November 28, 2009, 9:15pm UTC](https://www.ruby-forum.com/t/need-help-with-tunnel-connection-issue-in-net-ssh/179567 "2009-11-28T21:15:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delano\_Mandelbaum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d26b3c/32.png) [@Delano\_Mandelbaum](https://www.ruby-forum.com/u/Delano_Mandelbaum)\
**Post date:** [November 28, 2009, 9:15pm UTC](https://www.ruby-forum.com/t/need-help-with-tunnel-connection-issue-in-net-ssh/179567/1 "2009-11-28T21:15:28Z")

</div>

Hello!

I need some help resolving an issue with running several connections  
simultaneously through a single tunnel connection. From the bug  
report:

Where I noticed an issue is when utilized a forwarded port created  
with Net::SSH to connect a local port to a remote host http proxy  
server. A browser, then configured locally to use said local port will  
obviously utilize alot of simultaneous connections as it makes  
requests through the connection. We’re noticing that if you’re “nice”  
and allow pages to load (connections to be created, used, then  
shutdown gracefully) you’re fine - but if you interrupt the connection  
by browsing to other links in mid-download, or hit your stop button,  
we see “connection forcibly reset” exceptions from buffered\_io.rb’s  
fill method, and then the forwarded connection is basically locked up  
until you re-establish.

And there’s a script to help reproduce it.

> <https://github.com/net-ssh/net-ssh/blob/2.0/support/ssh_tunnel_bug.rb>

The bug report is here:  
[http://net-ssh.lighthouseapp.com/projects/36253/tickets/7-an-existing-connection-was-forcibly-closed-by-the-remote-host#ticket-7-3](http://net-ssh.lighthouseapp.com/projects/36253/tickets/7-an-existing-connection-was-forcibly-closed-by-the-remote-host#ticket-7-3)

If someone can help resolve it I’ll incorporate the fix into the next  
release (with kudos, of course!).

Delano
