chr15m / bugout

Back end web app services over WebRTC.
https://chr15m.github.io/bugout
MIT License
604 stars 59 forks source link

How could I use Bugout for TCP tunneling? #58

Closed hello-smile6 closed 2 years ago

hello-smile6 commented 2 years ago

I need to have an HTTP server on one device accessible on another, and netcat won't work. Could I use Bugout? If so, how?

draeder commented 2 years ago

Bugout isn't designed for this use-case, but it is theoretically possible. When server-to-server, Bugout uses the wrtc library as a transport. That library follows common WebRTC protocol specs. At that level, it is very similar to websockets... If you have some code examples of how you're trying to make it work, I might be able to help.

hello-smile6 commented 2 years ago

Bugout isn't designed for this use-case, but it is theoretically possible. When server-to-server, Bugout uses the wrtc library as a transport. That library follows common WebRTC protocol specs. At that level, it is very similar to websockets... If you have some code examples of how you're trying to make it work, I might be able to help.

Sure. https://replit.com/@9pfs/counterdev-2 I'm trying to run a counter.dev instance on Replit, but Replit refuses to work if there is more than one program running a TCP server. Since the Go library that counter.dev uses doesn't support Unix sockets, I have no way to avoid the second TCP server from Redis. If I could just tunnel traffic through another server, it'd work. I know I couldn't use TCP for that, and I don't think UDP would work either, so Bugout seems to be the only option. I know it'd probably be extremely slow (based on experience from libv86-terminal-forwarding), but it is all I can come up with.

draeder commented 2 years ago

That's a pretty specialized use case, my friend.

hello-smile6 commented 2 years ago

That's a pretty specialized use case, my friend.

I know it is. That's why it's frustrating.

draeder commented 2 years ago

I think Bugout can be used for streams.... I just haven't tried it. And I think that's what you want.

hello-smile6 commented 2 years ago

I think Bugout can be used for streams.... I just haven't tried it. And I think that's what you want.

That would make sense.

draeder commented 2 years ago

Let us know if you successfully use Bugout for streams! :)

hello-smile6 commented 2 years ago

Let us know if you successfully use Bugout for streams! :)

I'll try.

hello-smile6 commented 2 years ago

https://github.com/hello-smile6/bugout-tcp-tunneling Could use some help, I have no idea where to start.

hello-smile6 commented 2 years ago

Figured out how to make Replit let my website work.

chr15m commented 2 years ago

Glad you got it working. :+1:

hello-smile6 commented 2 years ago

Glad you got it working. 👍

I managed to get NodeBB to run on a Replit server too. https://nodebb.9pfs.repl.co/