I have two machines, one running Windows and the other running Ubuntu, and an application running on Ubuntu that connects to a server counterpart running either locally or remotely. The server is running remotely on Windows, and I am attempting to make the client app on Ubuntu believe that the server is actually running locally by forwarding the appropriate port (i.e. 5555) from Windows to Ubuntu. I then tell the client app to connect locally to 127.0.0.1 on the specific port I have set. When this happens, I get the following error in my terminal:
C:\>debug1: Connection to port 5555 forwarding to localhost port 5555 requested. debug2: fd 9 setting TCP_NODELAY debug2: fd 9 setting 0_NONBLOCK debug3: fd 6 is 0_NONBLOCK debug1: channel 3: new [direct-tcpip] buffer_get_ret: trying to get more bytes 4 than in buffer 0 buffer_get_string_ret: cannot extract length buffer_get_string: buffer error
At this point the SSH connection is terminated, dumping me back to a regular terminal prompt. My knowledge of SSH is pretty much limited to connecting to another machine for remote control; port forwarding is new to me so any insight is very appreciated!
Update: I solved the issue by SSHing to the Ubuntu machine from the Windows machine with remote port forwarding. This effectively accomplishes the exact same thing as what I attempted previously. This way produced no errors or disconnection when I connected the client app on the Ubuntu machine to the server app running on Windows.
While this of course makes me happy, as I accomplished my objective, I would now like to figure out why this second way works (remote port forwarding from Windows to Ubuntu, initiated by Windows) and the first way does not (local port forwarding from Windows to Ubuntu, initiated by Ubuntu).