For Node's Service Bus v7 messaging client behind an HTTP proxy, use the SDK sample's AMQP-over-WebSockets arrangement:

const { ServiceBusClient } = require("@azure/service-bus");
const WebSocket = require("ws");
const { HttpsProxyAgent } = require("https-proxy-agent");

const proxyAgent = new HttpsProxyAgent(proxyUrl);
const client = new ServiceBusClient(connectionString, {
  webSocketOptions: {
    webSocket: WebSocket,
    webSocketConstructorOptions: { agent: proxyAgent },
  },
});

Supply the proxy URL and Service Bus connection string. For an allowed public Service Bus namespace test without proxy authentication, an HTTP entry from the HTTP proxy list can supply proxyUrl. The ws and https-proxy-agent packages must already be application dependencies. The underlying ws proxy-agent interface keeps the WebSocket service and proxy addresses separate.

This constructs the client; connecting occurs when a sender or receiver performs an operation. Retain it for that workload and await client.close() on shutdown.

Locate a failure among proxy tunnel setup, WebSocket negotiation and the Service Bus operation. The proxy must permit that destination and session. Short HTTPS access does not prove upgrade support or an acceptable long-lived connection limit.

This is the connection-string overload. An identity credential can add a separately configured token-acquisition path. Old azure-sb REST snippets use another generation; identify the package before selecting its transport options.

Winndannde jowitiiɗe heen