MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / createUnixSocketAuthProxy

Function createUnixSocketAuthProxy

src/ssh/SSHAuthProxy.ts:109–135  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

107}
108
109async function createUnixSocketAuthProxy(id: string): Promise<AuthProxyInfo> {
110 const socketPath = `/tmp/claude-ssh-auth-${id}.sock`
111
112 const server = Bun.serve({
113 unix: socketPath,
114 fetch: req => proxyFetch(req, null),
115 })
116
117 logForDebugging(`[SSHAuthProxy] listening on unix:${socketPath}`)
118
119 const proxy: SSHAuthProxy = {
120 stop() {
121 server.stop(true)
122 try {
123 unlinkSync(socketPath)
124 } catch {
125 // Socket file may already be cleaned up
126 }
127 },
128 }
129
130 return {
131 proxy,
132 localAddress: socketPath,
133 authEnv: { ANTHROPIC_AUTH_SOCKET: socketPath },
134 }
135}
136
137async function createTcpAuthProxy(id: string): Promise<AuthProxyInfo> {
138 const nonce = randomUUID()

Callers 1

createAuthProxyFunction · 0.85

Calls 2

proxyFetchFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected