How to use the @firebase/webchannel-wrapper.createWebChannelTransport function in @firebase/webchannel-wrapper

To help you get started, we’ve selected a few @firebase/webchannel-wrapper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github firebase / firebase-js-sdk / packages / firestore / src / platform_browser / webchannel_connection.ts View on Github external
openStream(
    rpcName: string,
    token: Token | null
  ): Stream {
    const urlParts = [
      this.baseUrl,
      '/',
      RPC_STREAM_SERVICE,
      '/',
      rpcName,
      '/channel'
    ];
    const webchannelTransport = createWebChannelTransport();
    const request: WebChannelOptions = {
      // Background channel test avoids the initial two test calls and decreases
      // initial cold start time.
      // TODO(dimond): wenboz@ mentioned this might affect use with proxies and
      // we should monitor closely for any reports.
      backgroundChannelTest: true,
      // Required for backend stickiness, routing behavior is based on this
      // parameter.
      httpSessionIdParam: 'gsessionid',
      initMessageHeaders: {},
      messageUrlParams: {
        // This param is used to improve routing and project isolation by the
        // backend and must be included in every request.
        database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`
      },
      sendRawJson: true,

@firebase/webchannel-wrapper

A wrapper of the webchannel packages from closure-library for use outside of a closure compiled application

Apache-2.0
Latest version published 18 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages