Skip to content

Commit

Permalink
Merge pull request #3247 from bdarnell/websocket-update
Browse files Browse the repository at this point in the history
websocket: Add resolver argument to websocket_connect
  • Loading branch information
bdarnell committed Apr 8, 2023
2 parents f964ab6 + 4f85f3e commit d369a78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/releases/v6.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Deprecation notices

- It is now much faster (no longer quadratic) to receive large messages that
have been split into many fragments.
- `.WebSocketClientConnection` now accepts a ``resolver`` parameter.
- `.websocket_connect` now accepts a ``resolver`` parameter.

``tornado.wsgi``
~~~~~~~~~~~~~~~~
Expand Down
16 changes: 8 additions & 8 deletions tornado/websocket.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer to http://caniuse.com/websockets for details).
communication between the browser and server. WebSockets are supported in the
current versions of all major browsers.
This module implements the final version of the WebSocket protocol as
defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_. Certain
browser versions (notably Safari 5.x) implemented an earlier draft of
the protocol (known as "draft 76") and are not compatible with this module.
defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_.
.. versionchanged:: 4.0
Removed support for the draft 76 protocol version.
Expand Down Expand Up @@ -1589,6 +1584,7 @@ def websocket_connect(
ping_timeout: Optional[float] = None,
max_message_size: int = _default_max_message_size,
subprotocols: Optional[List[str]] = None,
resolver: Optional[Resolver] = None,
) -> "Awaitable[WebSocketClientConnection]":
"""Client-side websocket support.
Expand Down Expand Up @@ -1632,6 +1628,9 @@ def websocket_connect(
.. versionchanged:: 5.1
Added the ``subprotocols`` argument.
.. versionchanged:: 6.3
Added the ``resolver`` argument.
"""
if isinstance(url, httpclient.HTTPRequest):
assert connect_timeout is None
Expand All @@ -1653,6 +1652,7 @@ def websocket_connect(
ping_timeout=ping_timeout,
max_message_size=max_message_size,
subprotocols=subprotocols,
resolver=resolver,
)
if callback is not None:
IOLoop.current().add_future(conn.connect_future, callback)
Expand Down

0 comments on commit d369a78

Please sign in to comment.