Recently, I try to write socks5 server in python. you can see it here.
I begin to think a question. How I handle multiple requests from browser?
In this version, I use multiple threads to handle it. If I don’t want to use multiple thread, How can I design the code?
Take a look at the
selectmodule. In particular look at theselect()function.
select()is pretty low-level. Another alternative is the standard Pythonasyncoremodule. Check out the example echo server to see how easy it is to use.