I am trying to allow a sub-process, isolated by Pypy, to exchange data using a restricted protocol with the parent process.
After looking at the pypy/pypy/translator/sandbox/sandlib.py source code included in Pypy, it seems that VirtualizedSocketProc exists that allows os.open calls to open sockets. I changed some functions of the code (for example, allowing TCP connections on limited ports), but very little was changed. However, I cannot actually import the Pypy socket module, because it requires a non-existent _socket module, which seems to be in parts of the code at the interpreter level.
Am I trying to do this? If so, how do I import a socket module? If not, what else can I do?
source share