Just looked up what a proxy server does: https://www.varonis.com/blog/what-is-a-proxy-server/
Thinking about it, UniPCemu's server build essentially does the same in a way. It doesn't process the raw packets(at the TCP side) much, just a little filter on the IP address when receiving and adding data when sending(ethernet headers to be exact).
Actually, the UniPCemu server build itself isn't quite a modem(although the Dosbox/UniPCemu modem can connect to it through a TCP port). It's actually a TCP port that can be connected to and after successful authentication(ASCII text mode) starts acting as a proxy for SLIP-encoded packets instead. So it's actually more of a TCP-connection(instead of normal dial-up) ISP provider. Although there's a slight delay(for manual input during authentication) of a fraction of seconds (0.3 seconds) before it will switch to SLIP mode after saying "CONNECTED".
UniPCemu communicates on it's connected TCP port with a bit of text at the beginning(when authenticating the client), but when authentication is complete and verified, it changes mode to SLIP protocol.
When in SLIP protocol, it receives packets from the connected client, decodes it to a raw IPv4 packet, adds some static Ethernet header to redirect it to the router(as specified in it's settings)'s MAC and sends it away using Pcap.
The other way around is a bit more complicated. It receives all packets the computer receives(using Pcap packet sniffing), filters out only the set IP address and MAC and broadcast IP/MAC IPv4 packets(based on the settings), strips the ethernet header for it's raw IPv4 packet, then sending said packet(if not filtered away) to all connected and authenticated clients using the SLIP encoding.
So in a way, it's a SLIP-based kind of proxy.
I know that Linux can do this by itself, but since Windows stuff is either payed or difficult to set up for a TCP connection, I built that functionality into my emulator itself.
Running Dosbox Windows 95 IE and Arachne under MS-DOS runs like a charm with it! 😁 The only main downside is lack of HTTPS stuff and most websites infinitely redirecting to it because of that, but combined with Webone it should theoretically solve that problem and make it fully modern web compatible?
Thrre's still one strange thing I notice, though: when multiple users request a page at the same time, the browsers seem to wait for each other and only one of them succeeds retrieving the page(the others kind of hang)? That's also the case for a web browser on the host PC while a client is requesting a page? Anyone knows anything about that?
Edit: Just found a little bug in the server: when a packet was received, only the first client accepted it, all other clients didn't see the packet because the first client discards the received packet(and thus the other clients see no packet anymore). Said discarding is now done in the main polling instead(just before receiving a new packet through pcap).
Edit: It still doesn't fix the weird issue of other clients connected failing receiving their pages(and in the case of the other failing Dosbox session even corrupt the Arachne browser's URL field(hanging the whole thing completelty inside the Dosbox emulator) 😖 )