Score:0

Connecting two nodes, dynamic tcp connections tunneling through a central server

am flag

Conceptual system in my mind of what i'm looking for:

Given two hosts (can be pcs) !
Both can be on dynamic network (dynamic ip)!
Both connect to the same central server to find each other! (in my case need! One client host can act as a server too)
The server act as a bridge! And make the tunneling happen!
First host connect to the server! And the second too! Now the server map both nodes (hosts)!
And make forwarding (tunneling)!
Whenever host one send something to host 2 it will go to the central server! Through something like web socket! then the server send it to the second host! The second host answer back! Or whatever! The server handle the bridging and tunneling in the two ways!

Properties here:

  • nodes can connect dynamically! Without setting up networks or Dynamic dns ... Just like teamviewer or anydesk does!
  • tcp connections are tunneled and forwarded!
  • The two nodes connect and can work as if they were a one host!

To resume: pc1, pc2 => connect pc1 to pc2 without them having to know each other ip addresses! All dynamically! direct tunneling!

How to do that ?

After looking at different things! I just thought the easiet way is to implement something like that myself! as i can imgine how i can do it!

I needed that! While trying to run Android emulator on AWS EC2! And for forwarding adb to a remote emulator!

I'm not asking about solution for the android problem! But rather the system above! I'm wondering if there is already something that do what i described!

Otherwise it would take me some time!

For a solution that crossed my mind! I'm looking at a central websocket server! And tunneling tcp over ws!

What would be the name for such a system ?

And what are all the good possible ways to achieve that! How you would go about it ?

Some other ways then the system aboce that i looked up

For systems or problelms where you may think of the above! As like with the Android remote debugging!

One can think of:

Ssh reverse tunneling => require a static end! The server for example in my case! The server instance need to have ssh working! In AWS that require some work to setup a working agent! Not always straight forward!

Dynamic DNS => Port forwarding is needed! May be complicated to setup for some! Possible Security risks

Those for who may mention them! I'm only asking for the conceptual system mentioned above!

What i mentioned myself conceptually! Would be the most easy to go with thing and system! No complex setup to do! Just configure a one server! And all go smoothly and dynamically by design! Even for no advanced users! Like other developpers within the same team or organization! Just like teamviewer and anydesk and so many system already works!

djdomi avatar
za flag
Requests for product, service, or learning material recommendations are off-topic because they attract low quality, opinionated and spam answers, and the answers become obsolete quickly. Instead, describe the business problem you are working on, the research you have done, and the steps taken so far to solve it.
Mohamed Allal avatar
am flag
this is not a request for product srevice! I'm asking if things exists that can allow me to do so! Except from implementing a solution myself! I have good enough reputation on stackoverflow! and so many answers! And suggesting packages to solve a problem is something that we do all the time! Even suggesting all possible good options! How to do something => use this and that ! It's pretty useful! You can see too on the answer that i got here! Which kind of already save me and give me a strong cool option!
Mohamed Allal avatar
am flag
I mentionned too what's the problem and where i got it! But my question and wondering si about such a system and if there is implementation or open source libraries solutions that can help to implement such a system! i can update the question to include even more details! And why one may or can need such a thing! I need it part of our development flow! And basically here i needed that because i wanted to use a remote emulator for android development! we were using a Windows RDP in Aws and it doesn't support
Mohamed Allal avatar
am flag
virtualization and emulator device doesn't' work on it! But my question still not about that problem itself! i'm only wondering about establishing the system i described above! what's the name for such a system! ..
Mohamed Allal avatar
am flag
This absolutely is within our community rules and stand points! I understand what you may was refering too! And why it's nice to keep good rules going!
Mohamed Allal avatar
am flag
Now the question became longer!
Mohamed Allal avatar
am flag
@djdomi any helpful knoweldge and experience ??
Score:1
cn flag

Would something like openvpn as a solution to your problem be overkill? Openvpn does all you want but also encrypts network traffic. That encryption adds some complexity to the configuration.

Mohamed Allal avatar
am flag
Does openVpn support no need to know the addresses of the two hosts! The two hosts only connect to the central server! And they will be linked! When A => B it go like `A => Central<Only thing with known ip> => B` and `B => Central<Only thing with known ip> => C` I Thought Open VPN work like proxies and VPN usually! You just pass through it! And the traffic in an out way! A tunnel is established between any end! But you need to know the ip address of the other end! I want something that works just like any desk or teamviewer do! To implement i'm thinking about websocket!
Mohamed Allal avatar
am flag
But if there is something that works! I wouldn't! Specially something robust! And nope it wouldn't be an overhead! Set it once! and use it always
Henrik Carlqvist avatar
cn flag
With openvpn hosts are able to connect to the openvpn server and will be given an IP address in a subnet of your choice, e g 10.10.10.*. All machines connected to the same openvpn server will then be able to reach each other on those 10.10.10.* IP addresses and the traffic will go encrypted through the openvpn server.
Mohamed Allal avatar
am flag
I see! So that's should work! I'll check it and give it a try! Big Thanks
djdomi avatar
za flag
what you are looking for is a vpn solution.
Henrik Carlqvist avatar
cn flag
Yes, a vpn built by openvpn, vpnd or any other tool to build a virtual private network. The tricky thing with "vpn" is that it is sometimes confused with different proxy services for anonymous surfing.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.