Skip to content

Commit

Permalink
Pull laddress from a connected socket instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 17, 2024
1 parent dc4d7c6 commit bbccc77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sippy/Wss_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ async def ws_to_sip(self, websocket, path):
sender = create_task(self.sip_to_ws(queue, websocket))
conn_id = f'{websocket.id}.invalid'
self.connections[conn_id] = (websocket, queue)
if self.uopts.laddress[0] == '0.0.0.0':
sock = websocket.transport.get_extra_info('socket')
addr = sock.getsockname()
self.uopts.laddress = addr
print(f'WSS server is listening on {addr[0]}:{addr[1]}')
address = Remote_address(websocket.remote_address, self.transport)
address.received = conn_id
try:
Expand Down

0 comments on commit bbccc77

Please sign in to comment.