MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / fn

Function fn

e2e/python/test_sandbox_policy.py:81–91  ·  view source on GitHub ↗
(host, port)

Source from the content-addressed store, hash-verified

79 """Return a closure that sends a raw CONNECT and returns the status line."""
80
81 def fn(host, port):
82 import socket
83
84 conn = socket.create_connection(("10.200.0.1", 3128), timeout=10)
85 try:
86 conn.sendall(
87 f"CONNECT {host}:{port} HTTP/1.1\r\nHost: {host}\r\n\r\n".encode()
88 )
89 return conn.recv(256).decode("latin1")
90 finally:
91 conn.close()
92
93 return fn
94

Callers

nothing calls this directly

Calls 6

existsMethod · 0.80
closeMethod · 0.45
getMethod · 0.45
readMethod · 0.45
startMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected