MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / UnixSocketHTTPConnection

Class UnixSocketHTTPConnection

vmm/src/vmm-cli.py:349–363  ·  view source on GitHub ↗

HTTPConnection that connects to a Unix domain socket.

Source from the content-addressed store, hash-verified

347
348
349class UnixSocketHTTPConnection(http.client.HTTPConnection):
350 """HTTPConnection that connects to a Unix domain socket."""
351
352 def __init__(self, socket_path, timeout=None):
353 """Initialize with the given Unix socket path."""
354 super().__init__("localhost", timeout=timeout)
355 self.socket_path = socket_path
356
357 def connect(self):
358 """Connect to the Unix domain socket."""
359 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
360 if self.timeout:
361 sock.settimeout(self.timeout)
362 sock.connect(self.socket_path)
363 self.sock = sock
364
365
366class VmmClient:

Callers 1

requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected