use ConnectionParams.bindhost

This commit is contained in:
jesopo 2020-04-02 22:39:03 +01:00
parent 94c501d4de
commit 331cadfb39

View file

@ -46,7 +46,11 @@ class Server(IServer):
async def connect(self, params: ConnectionParams):
cur_ssl = sc if params.ssl else None
reader, writer = await asyncio.open_connection(
params.host, params.port, ssl=cur_ssl)
params.host,
params.port,
ssl=cur_ssl,
local_addr=(params.bindhost, 0))
self._reader = reader
self._writer = writer
self.params = params