INNER CODE UNIT · TypeScript
Promise
jasonjmcghee/claude-debugs-for-you · mcp/src/index.ts:43
return new Promise((resolve, reject) => {
const data = JSON.stringify(payload);
const req = http.request({
hostname: 'localhost',
port,
path: '/tcp',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)
}
}, res => {
let body = '';
res.on('data', chunk => body += chunk);
res.on('end', () => {
try {
const response = JSON.parse(body);