Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ephemeral port range control #17

Merged
merged 3 commits into from
Mar 2, 2023
Merged

Ephemeral port range control #17

merged 3 commits into from
Mar 2, 2023

Conversation

richardklafter
Copy link
Collaborator

Essentially just converted aiortc/aioice#63 PR into a monkey patch. It could use a bit more testing.

Should fix your last issue in #4 ?

@kristiankielhofner
Copy link
Contributor

Crashing with:

RTC: Created for 76.14.83.52
INFO:     76.14.83.52:57203 - "POST /api/rtc/asr?model=large HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/app/./main.py", line 455, in rtc_asr
    response = await rtc_offer(request, model, beam_size, task, detect_language, return_language)
  File "/app/./main.py", line 421, in rtc_offer
    await pc.setRemoteDescription(offer)
  File "/usr/local/lib/python3.8/dist-packages/aiortc/rtcpeerconnection.py", line 978, in setRemoteDescription
    await asyncio.gather(*coros)
  File "/usr/local/lib/python3.8/dist-packages/aiortc/rtcpeerconnection.py", line 176, in add_remote_candidates
    await asyncio.gather(*coros)
  File "/usr/local/lib/python3.8/dist-packages/aiortc/rtcicetransport.py", line 293, in addRemoteCandidate
    await self._connection.add_remote_candidate(
  File "/usr/local/lib/python3.8/dist-packages/aioice/ice.py", line 367, in add_remote_candidate
    mdns_protocol = await get_or_create_mdns_protocol()
  File "/usr/local/lib/python3.8/dist-packages/aioice/ice.py", line 39, in get_or_create_mdns_protocol
    _mdns.protocol = await mdns.create_mdns_protocol()
  File "/usr/local/lib/python3.8/dist-packages/aioice/mdns.py", line 158, in create_mdns_protocol
    tx_transport, _ = await loop.create_datagram_endpoint(
  File "/app/./main.py", line 73, in create_datagram_endpoint
    protocol_factory, local_addr=(local_addr[0], port), **kwargs
TypeError: 'NoneType' object is not subscriptable

main.py Show resolved Hide resolved
@kristiankielhofner kristiankielhofner merged commit f174628 into main Mar 2, 2023
@kristiankielhofner kristiankielhofner deleted the rk/ports branch March 2, 2023 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants