Skip to main content

Connection Problems

Troubleshooting guide for webhook connection issues, including network problems, firewall issues, and connectivity failures.

Common Connection Issues

"Connection refused" Errors

Symptoms:

Error: connect ECONNREFUSED
Failed to connect to endpoint
Connection refused at localhost:3000

Common Causes:

  1. Local server not running - Development server stopped
  2. Wrong port number - Targeting incorrect port
  3. Firewall blocking - Network security preventing connection
  4. Service down - Target service unavailable

Solutions:

Check Local Server

# Check if anything is running on the port
lsof -i :3000
netstat -an | grep 3000

# Start your development server
npm run dev
python manage.py runserver
rails server

Verify Port Configuration

# Check CLI configuration
hookvm listen endpoint-url --target http://localhost:3000/webhooks
# ^^^^
# correct port?

# Test connection directly
curl http://localhost:3000/webhooks

"Timeout" Errors

Symptoms:

Request timeout after 30000ms
Connection timed out
Socket timeout

Causes:

  • Slow network connection
  • Handler taking too long to respond
  • Server overloaded

Solutions:

// Optimize handler response time
app.post('/webhooks', (req, res) => {
// Respond immediately
res.status(200).json({ received: true });

// Process asynchronously
setImmediate(() => {
processWebhookData(req.body);
});
});

DNS Resolution Issues

Symptoms:

getaddrinfo ENOTFOUND
DNS resolution failed
Host not found

Solutions:

# Test DNS resolution
nslookup hookvm.com
dig hookvm.com

# Try IP address directly
ping 1.2.3.4

# Check DNS configuration
cat /etc/resolv.conf

Network Debugging

Test Connectivity

# Basic connectivity test
ping hookvm.com

# Port connectivity test
telnet hookvm.com 443
nc -zv hookvm.com 443

# HTTP connectivity test
curl -I https://hookvm.com

WebSocket Connection Testing

# Install wscat for WebSocket testing
npm install -g wscat

# Test WebSocket connection
wscat -c wss://hookvm.com/ws

Network Trace

# Trace network route (Unix/Linux/macOS)
traceroute hookvm.com

# Windows
tracert hookvm.com

# Monitor network traffic
sudo tcpdump -i any host hookvm.com

This section is under development. More connection troubleshooting content coming soon.