A computer program product including a non-transitory, computer-readable storage medium which stores executable code, which when executed by a computer, causes the computer to perform a method of operating a server computer running an application for client devices operating in multiple network namespaces, the method comprising:
- instantiating (i) multiple network namespace drivers, each network namespace driver configured to send and receive network namespace communication streams between client devices operating in respective network namespaces and the application, and (ii) a multiplexing driver configured to multiplex the network namespace communication streams received from the network namespace drivers for presentation to the application, each network namespace being a construct that provides a logical copy of a network stack, with its own routes, firewall rules, and network devices;
- receiving a request from a network namespace driver within a network namespace communication stream;
- providing the request and a network namespace identifier identifying the network namespace driver to a stream head within a multiplexed communication stream that includes requests from other network namespace drivers, the stream head presenting the requests to the application;
- receiving, over another multiplexed communication stream, a reply to the request along with the network namespace identifier from the stream head;
- in response to receiving the reply, selecting one of the network namespace drivers based on the network namespace identifier;
- and
- transmitting the reply to the selected network namespace driver to satisfy the request.