summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix a few errors found by pytype. (#906)HEADmasterTimo Ewalds2023-05-123-2/+3
| | | | | | | | | | | | | | | | | | * Fix pytype error: File "websocket/_wsdump.py", line 107, in <module>: Overriding method signature mismatch [signature-mismatch] Base signature: 'def code.InteractiveConsole.raw_input(self, prompt: str = ...) -> str'. Subclass signature: 'def RawInput.raw_input(self, prompt) -> Any'. Parameter 'prompt' must have a default value. * Fix pytype error: File "websocket/tests/echo-server.py", line 18, in main: Function Serve.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ws_handler, host, port: Optional[int] = ..., ...) Actually passed: (self, ws_handler, host, port: str) * Fix undefined variable error found by pytype: File "compliance/test_fuzzingclient.py", line 57, in <module>: Name 'case' is not defined [name-error]
* fix failed tests testSupportRedirect, testManualHeadersengn33r2023-04-081-2/+1
|
* use str.format() from PEP 3101engn33r2023-04-088-31/+31
|
* add details in bad status exceptionengn33r2023-04-072-2/+4
|
* fix: pass correct number of arguments to logging function (#898)ozichert2023-03-011-8/+8
| | | | | * fix: pass correct number of params to logging function * feat: change logging format to string formatting
* 1.5.1v1.5.1engn33r2023-02-054-3/+6
|
* Fix logic bug in #893engn33r2023-02-051-1/+1
|
* link to logic of run_foreverengn33r2023-01-261-1/+2
|
* Remove incorrect commentengn33r2023-01-261-1/+0
|
* 1.5.0v1.5.0engn33r2023-01-264-3/+10
|
* Refactor and fix reconnect and ping (#862)j-a-n2023-01-262-37/+156
| | | | | | | | | | | | | | | | | | | | * Refactor and fix reconnect and ping - Dispatcher: do not reconnect in loop - Avoid reconnect in recursion and hit maximum recursion depth - Close websocket before reconnect to avoid unclosed ssl.SSLSocket warnings - Start ping thread on socket connect - Stop ping thread on socket disconnect - Add reconnect test - Add callback exception test * Remove duplicate function * Also check passed app in testCallbackException * Test exception in callback method Co-authored-by: Jan Schneider <j.schneider@uib.de> Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* remove problematic CI test URLengn33r2023-01-261-7/+8
|
* update gh action versionsengn33r2023-01-264-8/+8
|
* Reduce "websocket connected" log to INFO level (#888)Carey Metcalfe2023-01-131-1/+1
|
* WebSocketApp.run_forever(), read(): skip decode() if skip_utf8_validation (#886)bubbleboy142023-01-061-1/+1
|
* 1.4.2v1.4.2engn33r2022-11-034-3/+8
|
* create_dispatcher() w/ is_ssl determined by url instead of sslopt (#875)bubbleboy142022-11-032-2/+3
| | | | | | | | | | | * create_dispatcher() w/ is_ssl determined by url instead of sslopt * added .lower() (per @rm-you's suggestion) * create_dispatcher() w/ parse_url()-derived is_ssl * Fix failing test, missing wss Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* Update codecov action to v3engn33r2022-10-261-1/+1
|
* Update docs to fix #863 (#872)engn33r2022-10-263-8/+19
|
* Add Python 3.11 to build CI, setup.pyengn33r2022-10-254-4/+5
|
* Remove broken websockets.org links from documentationengn33r2022-10-254-8/+10
|
* Possible* Redundancy In Key Generation (#864)benlazzero2022-10-061-1/+0
| | | Was digging through the code base the past few days as it's been an excellent aid in learning about Websockets and TCP. Noticed _create_sec_websocket_key was getting called twice per ws.connect method. I may be missing something, but thought I would bring it to your attention in case it's an artifact or something. Best Regards!
* 1.4.1v1.4.1engn33r2022-09-044-3/+8
|
* fix for stack growth on reconnect (#854)bubbleboy142022-09-043-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rel example * tweaked rel example for linter * added rel note to examples.rst * slightly more compact example * added example header * matched wording * _socket.recv(): _recv() except socket.error - changed or to and; added except TimeoutError - raise WebSocketTimeoutException * _app - custom dispatcher check_callback() integration (and fixed pyevent compatibility): WrappedDispatcher (for use with generic event dispatchers such as pyevent and rel); create_dispatcher() accepts dispatcher kwarg (default None), and if it is specified, returns a WrappedDispatcher; use create_dispatcher() (passing specified dispatcher if any) every time (regardless of dispatcher specification) * Add clarifying comment, rerun CI tests * Add space to make linter happy * working reconnect * rmed logs * added _logging.warning() disconnected/reconnected notifications to handleDisconnect() * moved connect notification and dispatcher.read() (if doread kwarg [default False] is True) to setSock() (prevents those lines from running on ConnectionRefusedError) * run_forever(): reconnect kwarg now specifies sleep() time (defualt 5) * handleDisconnect(): fixed log msg * run_forever() refactor: stabilized stack frame count (at least in rel mode); added stack frame count to disconnect (warning) log; grossly oversimplified ;) * dispatcher simplification via DispatcherBase and DispatcherBase/WrappedDispatcher.timeout() * _logging: info(); enableTrace() supports level kwarg (default "DEBUG") * handleDisconnect() uses info() log * Fix linting errors * moved timeout() from Dispatcher to DispatcherBase (thus also applying to SSLDispatcher) * reconnect()s for DispatcherBase (uses while loop) and WrappedDispatcher (uses timeout()); setSock() reconnecting (default False) kwarg - if reconnecting, skip handleDisconnect(); handleDisconnect() calls dispatcher.reconnect() * custom_dispatcher switch in handleDisconnect() * WrappedDispatcher constructor registers keyboard interrupt signal * DispatcherBase.reconnect(): wrapped while loop in KeyboardInterrupt try/except * fixed lint errors * _app: RECONNECT (default 5) and setReconnect() setter; WebSocketApp.run_forever() reconnect kwarg defaults to RECONNECT * tests.test_app: ws.setReconnect(0) (may fix test stall issue) * oops, added setReconnect import to websocket __init__ * blank line for linter * linter line * added rel to setup extras_require{test}[] * adjusted testRunForeverDispatcher() to use rel (including dispatch()) * setup: moved rel dep from extras_require{test}[] to tests_require[] * meh trying install_requires[] (tests_require[] depped??) * set RECONNECT (run_forever() reconnect kwarg default) to 0 (can be altered with setReconnect()) to preserve old (non-reconnecting) default behavior for existing integrations * rmed rel from install_requires[] (only added for tests, and was not working...) * test_app: rmed ws.setReconnect(0) (0 is new default) * run_forever() reconnect->RECONNECT fallback in func instead of kwarg default * test_app: disabled rel import (unsure how to set up test dependency) and testRunForeverDispatcher() (also not working previously afaik) * linter fixes * linter comment spaces * run_forever() returns False to pass testRunForeverTeardownCleanExit test * run_forever() returns False unless error (handleDisconnect() changes to True before calling on_error callback) * rval->self.has_errored Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* Clarify run_forever case when server closes WebSocketengn33r2022-08-261-1/+5
|
* Clean README, run doctest CI on README examplesengn33r2022-08-262-9/+62
|
* Replace 'coming soon' in docs with valid examplesengn33r2022-08-251-2/+23
|
* Fix doctest CI errorsengn33r2022-08-252-6/+6
|
* revert fc525b1, http proxy uses URL port unlike SOCKS proxiesengn33r2022-08-251-6/+6
|
* Fix path for doctest CIengn33r2022-08-251-1/+1
|
* Fix bug that set http proxy to port 80engn33r2022-08-251-6/+6
|
* Add doctest CI to sphinx docsengn33r2022-08-255-255/+261
|
* 1.4.0v1.4.0engn33r2022-08-244-3/+7
|
* Add rel install note in READMEengn33r2022-08-241-0/+3
|
* Allow passing `http_proxy_timeout` to `run_forever`. (#842)Adam Wojtczak2022-08-244-9/+19
| | | | | | | | | | * Allow passing `http_proxy_timeout` to `run_forever` * Normalize docstring * fix flake8 lint Co-authored-by: Adam Wojtczak <adam.wojtczak@cybercare.cc> Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* reconnect (#838)bubbleboy142022-08-242-72/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rel example * tweaked rel example for linter * added rel note to examples.rst * slightly more compact example * added example header * matched wording * _socket.recv(): _recv() except socket.error - changed or to and; added except TimeoutError - raise WebSocketTimeoutException * _app - custom dispatcher check_callback() integration (and fixed pyevent compatibility): WrappedDispatcher (for use with generic event dispatchers such as pyevent and rel); create_dispatcher() accepts dispatcher kwarg (default None), and if it is specified, returns a WrappedDispatcher; use create_dispatcher() (passing specified dispatcher if any) every time (regardless of dispatcher specification) * Add clarifying comment, rerun CI tests * Add space to make linter happy * working reconnect * rmed logs * added _logging.warning() disconnected/reconnected notifications to handleDisconnect() * moved connect notification and dispatcher.read() (if doread kwarg [default False] is True) to setSock() (prevents those lines from running on ConnectionRefusedError) * run_forever(): reconnect kwarg now specifies sleep() time (defualt 5) * handleDisconnect(): fixed log msg * run_forever() refactor: stabilized stack frame count (at least in rel mode); added stack frame count to disconnect (warning) log; grossly oversimplified ;) * dispatcher simplification via DispatcherBase and DispatcherBase/WrappedDispatcher.timeout() * _logging: info(); enableTrace() supports level kwarg (default "DEBUG") * handleDisconnect() uses info() log * Fix linting errors Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* 1.3.3v1.3.3engn33r2022-06-204-3/+8
|
* Fix unclosed socket when 'error.errno in eConnRefused'. (#826)bvd02022-06-011-3/+2
|
* Add utf8 encoding error workaroundengn33r2022-05-091-1/+10
|
* update dict access (#818)மனோஜ்குமார் பழனிச்சாமி2022-05-081-7/+7
| | | | | | | | | | | * update dict access ``` if 'header' not in options or 'Sec-WebSocket-Key' not in options['header']: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable``` * Remove extra space for linter Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* 1.3.2v1.3.2engn33r2022-03-294-3/+9
|
* Fix typo in FAQ section (#805)Dezmerean Robert2022-03-191-2/+2
|
* Add support to pass pre-initialized stream socket when creating WebSocketApp ↵redphx2022-03-191-2/+6
| | | | | | | | | (#802) (#804) * Add support to pass pre-initialized stream socket when creating WebSocketApp (#802) * Fix CI linting error Co-authored-by: engn33r <engn33r@users.noreply.github.com>
* Remove rel.saferead() because of WrappedDispatcherengn33r2022-03-113-4/+0
|
* Remove EOL Python 3.6 referencesengn33r2022-02-252-2/+2
|
* Start adding type hintsengn33r2022-02-251-11/+11
|
* Linting improvements, improved flake8 linting CI cmdengn33r2022-02-2518-133/+89
|
* 1.3.1v1.3.1engn33r2022-02-255-3/+12
|
* Remove EOL Python 3.6 from setup.pyengn33r2022-02-251-1/+0
|
* Minor improvement of example documentationengn33r2022-02-251-3/+9
|