Skip to content

Releases: tarasko/picows

1.20.0 (2026-05-08)

08 May 18:30

Choose a tag to compare

  • WSTransport send, send_ping, send_pong, send_close can now accept str type as message. The message will be encoded as utf-8 before sending
  • Introduce new exceptions: WSInvalidMessageError, WSInvalidStatusError, WSInvalidHeaderError, WSInvalidUpgradeError
  • ws_connect/ws_create_server logger_name parameter can now accept a logger-like object
  • ws_connect/ws_create_server websocket_handshake_timeout param can now accept None to disable handshake timeouts
  • Allow sending close frames only using send_close to simplify logic
  • Raise ValueError instead of assert on some invalid user input
  • Added rsv2 and rsv3 to WSTransport send methods
  • User on_ws_connect and on_ws_frame implementation can now signalize protocol errors by raising WSProtocolError
  • Add is_disconnected property to WSTransport.
  • Fix send_* methods raising exceptions when attempting to send after connection abort and without prior CLOSE frame.
  • Add missing WSUpgradeResponse.body attribute at the client side.
  • Add missing WSTransport.request attribute for the server side.
  • ws_connect can now accept listener_factory that takes WSUpgradeRequest, WSUpgradeResponse as arguments. Old argument-less client_factory also works.

1.19.0 (2026-04-24)

24 Apr 21:11

Choose a tag to compare

  • Enable sse2, avx2, avx512, neon speedups for windows builds
  • Disconnect if unknown frame opcode is received (RFC 6455 requirement)
  • Disconnect if client doesn't mask frame or server mask (RFC 6455 requirement)
  • Do not log "Protocol writing pause/resume requested" if user overrides WSListener pause_writing/resume_writing
  • Allow rsv2 and rsv3 bits in frames
  • Use Transport.write_nocheck from aiofastnet 0.5.0 for performance

1.18.0 (2026-04-03)

03 Apr 13:59

Choose a tag to compare

  • Raise exception if WSTransport methods are called from a wrong thread.
  • Add examples illustrating how to properly utilized multithreading with free-threaded Python.
  • Install aiofastnet and use it by default.
  • Fix docs compilation and add 'free threaded python' topic guide

1.17.0 (2026-03-13)

13 Mar 07:14

Choose a tag to compare

1.17.0 (2026-03-13)

  • Improve masking performance on large frames.
  • Add aiofastnet as an optional dependency to speedup networking.

1.16.0 (2026-02-27)

27 Feb 13:12

Choose a tag to compare

  • Add socket_factory argument to ws_connect
  • Formalize exception hierarchy, new exceptions added: WSProtocolError, WSHandshakeError
  • Send CLOSE(MESSAGE_TO_BIG) instead of CLOSE(PROTOCOL_ERROR) on frame size violation
  • Deprecate zero_copy_unsafe_ssl_write in ws_connect and ws_create_server

1.15.0 (2026-02-22)

22 Feb 02:22

Choose a tag to compare

  • Expose WSTransport.is_close_frame_sent read-only property
  • Add 'Graceful websocket shutdown' topic guide
  • Add 'Setting socket options' topic guide
  • Always use BufferedProtocol (previously was only used with uvloop)
  • Implement exponential grow of the internal read buffer
  • Add read_buffer_init_size argument to ws_connect and ws_create_server
  • Add zero_copy_unsafe_ssl_write argument to ws_connect and ws_create_server

1.14.0 (2026-02-19)

19 Feb 00:40

Choose a tag to compare

  • WSTransport.wait_disconnected raises WSError exception if disconnect was cause by protocol parsing error.
  • Transfer user exception from on_ws_disconnected to wait_disconnected on the client side
  • Expand 'Exceptions handling' topic guide to explain how exceptions are transferred from user callbacks to wait_disconnected

1.13.1 (2026-02-15)

15 Feb 12:35
59cfff7

Choose a tag to compare

  • Add more examples and update docs

1.13.0 (2026-02-14)

14 Feb 14:06

Choose a tag to compare

  • #23: add support for SOCKS4, SOCKS5, HTTP proxies (no support for HTTPS proxy yet)

1.12.0 (2026-02-11)

11 Feb 16:38

Choose a tag to compare

  • #71: add support for HTTP redirects
  • Following discussion #68 added raw_header, raw_body and response attributes to WSError exception.
  • Added additional checks for URL and WSInvalidURL exception
  • Some non-latency critical code has been "de-cythonized" for better debugging experience.
  • WSUpgradeRequest, WSUpgradeResponse, WSUpgradeResponseWithListener moved to a pure python module
  • Mark picows extension module freethreading compatible

If your picows imports break after upgrading to 1.12.0 make sure you are importing from the package level.
Correct:
from picows import WSListener, WSFrame, WSUpgradeResponse

Wrong:
from picows.picows import WSListener, WSFrame, WSUpgradeResponse

The only exception to this are Cython definitions. You still have to cimport them from picows.picows
from picows.picows cimport WSListener, WSFrame