Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networking support #3

Open
avaer opened this issue Dec 15, 2019 · 5 comments
Open

Networking support #3

avaer opened this issue Dec 15, 2019 · 5 comments

Comments

@avaer
Copy link

avaer commented Dec 15, 2019

Any chance we would be able to do netcat/curl/wget/dig type things inside of the VM?

Obviously the browser has a lot of restrictions on network so these probably can't work the usual way, but I'm wondering if we could get a basic fetch or XHR-type thing in there. It seems it would be logically possible with all of the existing resource sharing.

Also, is this the right repository for this question? :P

@humphd
Copy link
Owner

humphd commented Dec 15, 2019

You could get those built into this vm, yes. All it would require is to tweak the buildroot packages that get installed via the menu configs, which I discuss how to do in the README. However, I didn't do it for a couple of reasons:

  1. VM size. Everything you add, even "small" utilities like these, start to increase the size of the VM significantly. For my purposes, I wanted it to be as small as possible, so I don't bundle a ton of things I'd love to have.
  2. Same-Origin. Once you have all this networking gear in place, you can't really do much because of same-origin policies in the browser. You could XHR/fetch data from the host that served the VM. But you can't satisfy what most users would expect, namely, arbitrary networking to third-party hosts.

The v86 "hardware" I'm using here does support networking, if you want to play with it. You just have to run your own proxy server, and via WebSockets, you can get out to the wider internet. He's also got a heavier VM running Archlinux, which has the networking enabled.

@dawnofman
Copy link

@humphd I have added the required package, device driver using Linux-menuconfig. Although it fails to add the network interface (for instance : eth0). The booting fails if I use v86 bios and Filer included libv86.js from browser-shell. I am really stuck to figure out where is the issue. My purpose is to have stream of data fed into a process running inside the VM through network port. Any suggestion?

@humphd
Copy link
Owner

humphd commented Apr 11, 2021

I think you should talk to the v86 folks, I've never played with their networking support, and the work I have in this repo specifically has it all disabled.

@dawnofman
Copy link

I cracked it and thank you!

@SahidMiller
Copy link

SahidMiller commented Aug 12, 2021

Holy shit this package is amazing. Networking side can be solved using a library like https://github.com/SahidMiller/network-stackify on the front end with go-ipfs p2p streams on the backend. go-ipfs is particularly useful as a generic server side websocket tunnel / exit node, but with much more features for configuration.

The real kicker is that once SSH is tunneled over libp2p and the browser terminal connects (I used xtermjs + ssh2 for this) then the user can create new tunneled connections to other ips using go-ipfs... actually, it might be possible to reuse that SSH connection to forward to any ip, never needing to touch go-ipfs again.

I think the VM just needs to act like these websocket connections are legit TCP connections like you would js and polyfilling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants