X Tutup
Skip to content

Commit c3797e5

Browse files
authored
Merge pull request qwj#12 from mosajjal/patch-1
SO_REUSEPORT option
2 parents 09cb333 + 2559948 commit c3797e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pproxy/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def start_server(self, args, option):
297297
if self.unix:
298298
return asyncio.start_unix_server(handler, path=self.bind, ssl=self.sslserver)
299299
else:
300-
return asyncio.start_server(handler, host=self.host_name, port=self.port, ssl=self.sslserver)
300+
return asyncio.start_server(handler, host=self.host_name, port=self.port, ssl=self.sslserver, reuse_port=args.reuse)
301301
@classmethod
302302
def compile_relay(cls, uri):
303303
tail = cls.DIRECT
@@ -408,6 +408,7 @@ def main():
408408
parser.add_argument('--get', dest='gets', default=[], action='append', help='http custom {path,file}')
409409
parser.add_argument('--sys', action='store_true', help='change system proxy setting (mac, windows)')
410410
parser.add_argument('--test', help='test this url for all remote proxies and exit')
411+
parser.add_argument('--reuse', help='set SO_REUSEPORT (Linux only)', dest='reuse', action='store_true')
411412
parser.add_argument('--version', action='version', version=f'%(prog)s {__version__}')
412413
args = parser.parse_args()
413414
if args.test:

0 commit comments

Comments
 (0)
X Tutup