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

if "sec-websocket-key" not in request_headers: #1574

Open
francois-vz opened this issue Nov 28, 2024 · 3 comments
Open

if "sec-websocket-key" not in request_headers: #1574

francois-vz opened this issue Nov 28, 2024 · 3 comments

Comments

@francois-vz
Copy link

Hi, just wanted to point out that I had to change streaming_server.py:587

        if "sec-websocket-key" not in request_headers:

to

        if "sec-websocket-key" not in request_headers.headers.keys():

to get it to work / accept incoming requests. Original error message:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/websockets/asyncio/server.py", line 353, in conn_handler
    await connection.handshake(
  File "/usr/local/lib/python3.11/dist-packages/websockets/asyncio/server.py", line 204, in handshake
    raise self.protocol.handshake_exc
  File "/usr/local/lib/python3.11/dist-packages/websockets/asyncio/server.py", line 146, in handshake
    response = await response
               ^^^^^^^^^^^^^^
  File "/workspace/sherpa-onnx/./python-api-examples/streaming_server.py", line 588, in process_request
    if "sec-websocket-key" not in request_headers:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'Request' is not iterable
@csukuangfj
Copy link
Collaborator

Could you make a pull request?

@francois-vz
Copy link
Author

I don't think I have the right permissions:

remote: Permission to k2-fsa/sherpa-onnx.git denied

@csukuangfj
Copy link
Collaborator

Anyone can make.a.pull request.

Not everyone can push directly to.the. current repo.

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

No branches or pull requests

2 participants