Is it possible to warp multi tcp connection to single server process with xinetd?

234 Views Asked by At

I'm using a script on my server side to encrypt my tcp data (source here), but I'm not use it that much and not want it always running and keep using cpu/memory, so I want to use xinetd to solve my problem.

Here is my xinetdconfig:

service shadowsocks
{
    socket_type     = stream
    only_from       = 0.0.0.0
    wait            = no
    user            = root
    protocol        = tcp
    server          = /path/to/my/script/server.py
    server_args     = -p 8888 -k my_password
    disable         = no
}

When I run the client, it will have multi connection in a second, and as the server using gevent, it is not necessary have multi process to run the server, but by default, xinetd will create a process per connection.

I've tried to set flags with REUSE or NOLIBWRAP, or set instances to 1, or set wait to yes, but none of them works.

It will be very grateful if you can tell me how to solve this problem, Thanks.

0

There are 0 best solutions below