LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2015, 09:13 AM   #1
Vlad.BG
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Rep: Reputation: Disabled
Lightbulb WebSocket over SSH tunnel - is it possible?


Hello,

I have a video streaming application that utilizes a WebSocket for the server <-> client communication. My goal is to make the video streaming service available over the internet in the cases where neither the server nor client have public IPs.

One way to do this is over a VPN connection, but I prefer not to use a VPN at all. That's why I decided to try and forward the communication over an SSH server via remote port forwarding.

However I am facing an issue - forwarding the server socket is pretty straight-forward, but I have no way to know in advance what the randomly allocated client port will be, so the traffic will flow only in the direction client -> SSH server -> streaming server.

When the SSH relay point receives the responses from the streaming server it does not automatically route them back to the client and the WebSocket handshake cannot be completed.

Do you think it is possible to overcome this issue or should I drop the WebSocket altogether and revert to a normal HTTP / TCP connection?

Thanks!
 
Old 01-17-2015, 01:53 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Quote:
Originally Posted by Vlad.BG View Post
My goal is to make the video streaming service available over the internet in the cases where neither the server nor client have public IPs.
"The Internet" simply requires routable IP addresses. This means that either you're skipping over "simple" solutions like exposing the stream via a load balancer like Haproxy (it will happily use backends that have non-routable LAN IP adresses) or you are not providing us with all the details we should have.
 
Old 01-18-2015, 05:41 AM   #3
Vlad.BG
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Unfortunately, both the video streaming server and client will be connecting to the Internet via a mobile network, so it will not be possible to use any form of proxy between them.
At the time of writing my original post, the idea was to put the WebSocket server on the same device as the video streaming server application, which turned out to be a completely inadequate solution to the problem...

So, instead of situating my WebSocket listener on the streaming server device, I will put it in a 'mid point', where both the streaming server and clients will be able to connect (so both of them will be WebSocket clients).
A piece of software will then handle the WebSocket connections and video streaming through a basic set of API commands and hopefully I will get what I want.

This type of architecture also makes a lot more sense with regard to the original purpose of the WebSocket design.
 
Old 01-18-2015, 08:42 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Quote:
Originally Posted by Vlad.BG View Post
Unfortunately, both the video streaming server and client will be connecting to the Internet via a mobile network, so it will not be possible to use any form of proxy between them.
I did not say "proxy" I said load balancer.


Quote:
Originally Posted by Vlad.BG View Post
So, instead of situating my WebSocket listener on the streaming server device, I will put it in a 'mid point', where both the streaming server and clients will be able to connect (so both of them will be WebSocket clients).
You're essentially saying the same as I did only phrased differently ;-p
 
  


Reply

Tags
http, ssh, ssh forwarding, tcp, websocket


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Reverse Tunnel - ~/.ssh/config - PHP marcelp1 Linux - Newbie 1 05-28-2014 01:49 AM
LXer: How to configure Varnish for WebSocket traffic LXer Syndicated Linux News 0 04-04-2014 08:41 PM
Initiate ssh tunnel to connect to ssh? brianmcgee Linux - Security 2 09-07-2011 11:07 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration