MCPcopy Create free account
hub / github.com/ElementsProject/lightning / __init__

Method __init__

tests/test_connection.py:4461–4470  ·  view source on GitHub ↗
(self, hostname, port)

Source from the content-addressed store, hash-verified

4459 # Adapter to turn web secure socket into a stream "connection"
4460 class BindWebSecureSocket(object):
4461 def __init__(self, hostname, port):
4462 certfile = f'{wss_proxy_certs}/client.pem'
4463 keyfile = f'{wss_proxy_certs}/client-key.pem'
4464 self.ws = websocket.WebSocket(sslopt={"cert_reqs": ssl.CERT_NONE, "ssl_version": ssl.PROTOCOL_TLS_CLIENT, "certfile": certfile, "keyfile": keyfile})
4465 self.ws.settimeout(TIMEOUT)
4466 try:
4467 self.ws.connect("wss://" + hostname + ":" + str(port))
4468 except Exception as e:
4469 raise Exception(f"WebSocket connection failed: {e}")
4470 self.recvbuf = bytes()
4471
4472 def send(self, data):
4473 self.ws.send(data, websocket.ABNF.OPCODE_BINARY)

Callers

nothing calls this directly

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected