You can emulate a networking layer in the browser for different workloads to talk to each other, think an http server and client.
Of course the browser can't offer an actual networking stack by itself, but you can augment that by proxying traffic through a server over Websockets/WebRTC.
Wasmer might have some plans in that direction...