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

UnicodeDecodeError #64

Open
2t6h opened this issue Sep 3, 2018 · 5 comments
Open

UnicodeDecodeError #64

2t6h opened this issue Sep 3, 2018 · 5 comments

Comments

@2t6h
Copy link

2t6h commented Sep 3, 2018

message = self.request.recv(1024).decode().strip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 4: invalid start byte

@Laura055
Copy link

Yea I have the same problem

@adeora
Copy link

adeora commented Dec 14, 2018

+1, also running into this

@Jawmo
Copy link

Jawmo commented Mar 24, 2019

This appears due to trying to utilize an SSL on the server. I received the same message. Have you guys found a way around this? Are you also utilizing nginx in your projects?

When attempting a proxy_pass, I then receive a new error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 721, in __init__
    self.handle()
  File "/home/damian/hopemud/websocket_server/websocket_server.py", line 199, in handle
    self.handshake()
  File "/home/damian/hopemud/websocket_server/websocket_server.py", line 337, in handshake
    assert headers['upgrade'].lower() == 'websocket'
KeyError: 'upgrade'

@atrebbi
Copy link

atrebbi commented Oct 6, 2019

I had the same error
I have proxied the websocket through apache, that manages ssl , with the following in VirtualHost (the websocket server runs on port 13100)

<VirtualHost :443>
...
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .
ws://yourserver.com:13100%{REQUEST_URI} [P]
...

and my client simply connects to
wss://yourserver.com

@Alveona
Copy link

Alveona commented Dec 4, 2019

I accidentally tried to connect through 'wss' to my local server, which hadn't any certificates and that was causing this error.
Changing to 'ws' protocol resolved this

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

6 participants