適用於 Node.js 的 Azure Relay 模組Azure Relay modules for Node.js

Azure 轉送服務可建立混合式應用程式,方法是讓您以安全的方式向公用雲端公開位於企業網路內部的服務,而無需開啟防火牆連線或要求對企業網路基礎結構的進行侵入式變更。The Azure Relay service creates hybrid applications by enabling you to securely expose services that reside within a corporate enterprise network to the public cloud, without having to open a firewall connection, or require intrusive changes to a corporate network infrastructure. 轉送支援各種不同的傳輸通訊協定和 Web 服務標準。Relay supports a variety of different transport protocols and web services standards.

深入了解 Azure 轉送Learn more about Azure Relay.

管理封裝Management package

安裝 npm 模組Install the npm module

安裝 Azure Relay npm 模組Install the Azure Relay npm module

npm install azure-arm-relay

範例Example

此範例會列出 Relay 用戶端的命名空間。This example lists the namespaces for a Relay client.

const msRestAzure = require('ms-rest-azure');
const RelayManagement = require('azure-arm-relay');

const subscriptionId = 'your-subscription-id';

msRestAzure
  .interactiveLogin()
  .then(credentials => {
    const client = new RelayManagement(credentials, subscriptionId);
    return client.namespaces.list();
  })
  .then(namespaces => {
    console.dir(namespaces, { depth: null, colors: true });
  })
  .catch(err => console.log(err));

範例Samples

深入探索可在應用程式中使用的 Node.js 程式碼範例Explore more sample Node.js code you can use in your apps.