title: Ocelot not passing websockets to microservice
body: <p>I'm trying to connect to SignalR hubs using Ocelot as proxy. SignalR is plugged in microservice that gateway passing through websockets traffic. Negotation via HTTP request is executed successfully, but further communication via websockets seems to be lost. I don't have an idea what is going on, especially that communication with the same configuration works perfectly when Azure SignalR on another environment is used. Below I present my configuration for gateway:</p>
  <p><strong>ocelot.json</strong></p>
  <pre><code>{
    &quot;DownstreamPathTemplate&quot;: &quot;/{anyHub}/negotiate&quot;,
    &quot;DownstreamScheme&quot;: &quot;http&quot;,
    &quot;DownstreamHostAndPorts&quot;: [
      {
        &quot;Host&quot;: &quot;communication&quot;,
        &quot;Port&quot;: 80
      }
    ],
    &quot;UpstreamHttpMethod&quot;: [ &quot;POST&quot; ],
    &quot;UpstreamPathTemplate&quot;: &quot;/{anyHub}/negotiate&quot;,
    &quot;ReRouteIsCaseSensitive&quot;: false,
    &quot;AuthenticationOptions&quot;: {
      &quot;AuthenticationProviderKey&quot;: &quot;Bearer&quot;,
      &quot;AllowedScopes&quot;: []
    },
    &quot;DelegatingHandlers&quot;: [
      &quot;IdentityInQuery&quot;
    ]
  },
  {
    &quot;DownstreamPathTemplate&quot;: &quot;/{anyHub}&quot;,
    &quot;ReRouteIsCaseSensitive&quot;: false,
    &quot;DownstreamScheme&quot;: &quot;ws&quot;,
    &quot;DownstreamHostAndPorts&quot;: [
      {
        &quot;Host&quot;: &quot;communication&quot;,
        &quot;Port&quot;: 80
      }
    ],
    &quot;UpstreamPathTemplate&quot;: &quot;/{anyHub}&quot;,
    &quot;UpstreamHttpMethod&quot;: [ &quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;, &quot;DELETE&quot;, &quot;OPTIONS&quot; ]
  },
  </code></pre>
  <p><strong>Part of gateway's Program.cs</strong></p>
  <pre><code>.Configure(async app =&gt;
  {
  await app
      .UseCors(cors =&gt;
  {
      cors.AllowAnyHeader()
          .AllowAnyMethod()
          .SetIsOriginAllowed(x =&gt; true)
          .AllowCredentials();
  }).UseOcelot();
  
  if (turnOnWebsockets)
      app.UseWebSockets();
  </code></pre>
  <p><strong>Particular microservice collection extensions:</strong></p>
  <pre><code>public static ISignalRBuilder AddSignalRConfiguration(this IServiceCollection services, bool isDevelopment)
  {
      var newServices = services.AddSignalR();
      if (!isDevelopment) newServices.AddAzureSignalR(Config.AzureSignalROptions.ConnectionString);
  
      return newServices;
  }
  
  public static IServiceCollection AddSignalRCors(this IServiceCollection services)
  {
      services.AddCors(options =&gt; options.AddPolicy(&quot;CorsPolicy&quot;,
          builder =&gt;
          {
              builder
                  .AllowAnyHeader()
                  .AllowAnyMethod()
                  .SetIsOriginAllowed(x =&gt; true)
                  .AllowCredentials();
          }));
  
      return services;
  }
  </code></pre>
  <p><strong>Part of IApplicationBuilder extension in particular microservice:</strong></p>
  <pre><code>public static IApplicationBuilder AddSignalR(this IApplicationBuilder app, bool isDevelopment)
  {
      app.UseRouting()
          .UseCors(&quot;CorsPolicy&quot;);
  
      if (isDevelopment)
      {
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapHub&lt;UserHub&gt;(&quot;/userHub&quot;);
              endpoints.MapHub&lt;ConversationHub&gt;(&quot;/conversationHub&quot;);
              endpoints.MapHub&lt;DiscussionHub&gt;(&quot;/discussionHub&quot;);
          });
      }
      ....
  
  
      return app;
  }
  </code></pre>
  <p>How can I use websockets with Ocelot and SignalR? The only transport method which gateway currently is able to communicate with SignalR is long polling, but for me it is not fully satisfactioning.  Thank you in advance for any help!</p>