WSClient (_rendezvous.py)

magic-wormhole · realtime, websocket-client, protocol-handshake, wormhole-protocol, integration

WebSocket client handling verified for Wormhole protocol

# Source: https://github.com/magic-wormhole/magic-wormhole | License: MIT | Copyright 2015 Brian Warner
# Provided via justclaw.it.com; keep this notice with the code.
import os
from urllib.parse import urlparse
from attr import attrs, attrib
from attr.validators import instance_of, optional
from zope.interface import implementer
from twisted.python import log
from twisted.internet import defer, endpoints, task
from twisted.application import internet
from autobahn.twisted import websocket
from . import _interfaces, errors
from .util import (bytes_to_hexstr, hexstr_to_bytes, bytes_to_dict,
                   dict_to_bytes, provides)

from ._status import Connecting, Connected


class WSClient(websocket.WebSocketClientProtocol):
    def onConnect(self, response):
        # this fires during

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key