Skip to content

Instantly share code, notes, and snippets.

@jeremymeng
Created May 2, 2022 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremymeng/a85b45db30bc093fc2b3fd28b0e59a59 to your computer and use it in GitHub Desktop.
Save jeremymeng/a85b45db30bc093fc2b3fd28b0e59a59 to your computer and use it in GitHub Desktop.
haproxy for testing amqp custom endpoint
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
const sbClient = new ServiceBusClient(connectionString, {
customEndpointAddress: "sb://127.0.0.1",
// WebSocket works too
// customEndpointAddress: "https://127.0.0.1:3000",
// webSocketOptions: {
// webSocket: ws,
// },
});
global
log /dev/log local0
log /dev/log local1 notice
stats timeout 30s
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
listen AMQP-5671
bind *:5671
mode tcp
option tcplog
maxconn 2000
timeout connect 5000
timeout client 50000
timeout server 50000
server jymtest jymtest.servicebus.windows.net:5671 check
listen AMQP-5672
bind *:5672
mode tcp
option tcplog
maxconn 2000
timeout connect 5000
timeout client 50000
timeout server 50000
server jymtest jymtest.servicebus.windows.net:5672 check
listen HTTPS-3000
bind *:3000
mode tcp
option tcplog
maxconn 2000
timeout connect 5000
timeout client 50000
timeout server 50000
server jymtest jymtest.servicebus.windows.net:443 check
docker run -d --name running-haproxy -v /home/azuser/projects/haproxy/config:/usr/local/etc/haproxy:ro -p 5671:5671 -p 5672:5672 -p 3000:3000 -p 20936:20936 --sysctl net.ipv4.ip_unprivileged_port_start=0 haproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment