Skip to content

@azure/web-pubsub-express_1.0.0-beta.4

Pre-release
Pre-release
Compare
Choose a tag to compare
@azure-sdk azure-sdk released this 11 Nov 01:07
63af817

1.0.0-beta.4 (2021-11-09)

Breaking Changes

  • Move allowedEndpoints settings into WebPubSubEventHandlerOptions. If not set, the default behavior is allowing all the incoming endpoints.

    const handler = new WebPubSubEventHandler("chat", {
      handleConnect(req, res) {
        // You can set the state for the connection, it lasts throughout the lifetime of the connection
        res.setState("calledTime", 1);
        res.success();
      },
      handleUserEvent(req, res) {
        var calledTime = req.context.states.calledTime++;
        console.log(calledTime);
        // You can also set the state here
        res.setState("calledTime", calledTime);
        res.success();
      },
      allowedEndpoints: ["https://xxx.webpubsub.azure.com"]
    });
  • Remove dumpRequest flag and leverage @azure/logger instead.