Skip to content

Commit

Permalink
Merge pull request #291 from galgeek/websocket-client-utf8fix
Browse files Browse the repository at this point in the history
add skip_utf8_validation parameter for websocket-client
  • Loading branch information
galgeek authored Oct 3, 2024
2 parents d987ba2 + 28b8149 commit f47a7cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion brozzler/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ def run(self):
# ping_timeout is used as the timeout for the call to select.select()
# in addition to its documented purpose, and must have a value to avoid
# hangs in certain situations
#
# skip_ut8_validation is a recommended performance improvement:
# https://websocket-client.readthedocs.io/en/latest/faq.html#why-is-this-library-slow
self.websock.run_forever(
sockopt=((socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),), ping_timeout=0.5
sockopt=((socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),),
ping_timeout=0.5,
skip_utf8_validation=True,
)

def _on_message(self, websock, message):
Expand Down

0 comments on commit f47a7cc

Please sign in to comment.