共用方式為


Web PubSub client protobuf protocol library for JavaScript

Azure Web PubSub is a cloud service that helps developers easily build real-time features in web applications with publish-subscribe patterns at scale.

You can use this library to add protobuf subprotocols including protobuf.reliable.webpubsub.azure.v1 and protobuf.webpubsub.azure.v1 support to @azure/web-pubsub-client library.

Getting started

Currently supported environments

Prerequisites

1. Install the @azure/web-pubsub-client-protobuf package

npm install @azure/web-pubsub-client-protobuf

2. Use Protobuf protocols

let client = new WebPubSubClient("client-access-url", { protocol: WebPubSubProtobufReliableProtocol() });

Troubleshooting

  • Enable logs

    You can set the following environment variable to get the debug logs when using this library.

export AZURE_LOG_LEVEL=verbose

For more detailed instructions on how to enable logs, you can look at the @azure/logger package docs.

  • Live Trace

    Use Live Trace tool from Web PubSub portal to view the live traffic.


Additional resources


Contributing

If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.