Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network: Fetch based browser networking (#1061)
Emulate a networking stack, intercept HTTP requests, serve them with fetch(). Enable by setting networking_proxy=fetch Somewhat fixes #198 Just enough networking for http to work for package managers and net-boot. The networking stack just reflects the macaddress of packets it receives, so shouldnt be bothered by mac address changes. Services include: - ARP replies by establishing the gateways IP - DHCP server sending gateway, dns, and client-ip - Gateway: 192.168.86.1 - Client: 192.168.86.100 - Netmask: 255.255.255.0 - UDP DNS server, all addresses resolve to: 192.168.87.1 - NTP Server, giving out the current time from Date() - Replies to ICMP pings to any IP address - UDP echo server on port 8 Limitations: - Request are limited by CORS rules, but CORS-proxies can work around this. - Redirects are handled transparently by fetch. The upside is sites that force an http->https upgrade appear to the VM to work over http. Future Work: - Allow HTTP requests from browser to be served by VM. - HTTPS support (maybe with help of a rust based TLS stack in WASM) - Support for POSTing binary data * Run devices tests in CI * Allow multiple Ne2k adapters Co-authored-by: Fabian <[email protected]>
- Loading branch information