ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.39k stars 1.64k forks source link

Ocelot Websockets doesn't forward headers #524

Closed JanKolk closed 6 years ago

JanKolk commented 6 years ago

Expected Behavior / New Feature

We are using ocelot with the feature websockets. We are using Signalr Core and trying to forward it to the correct server. With that we are using headers on the requests.

The headers disappear once it goes through ocelot. Is this on purpose? We verified that the headers will be send to the signalr server when it doen't use ocelot.

Config:

"ReRoutes": [{
      "DownstreamPathTemplate": "/{catchAll}",
      "DownstreamScheme": "ws",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 5000
        }
      ],
      "UpstreamPathTemplate": "/gateway/{catchAll}",
      "UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ]
    }]

Actual Behavior / Motivation for New Feature

The headers are being forwarded with the websockets

Steps to Reproduce the Problem

  1. Start a signalr core server
  2. Configure ocelot as described in http://ocelot.readthedocs.io/en/latest/features/websockets.html
  3. Connect a client throuh ocelot and send a header with it.
  4. Check the headers received on the server

Specifications

TomPallister commented 6 years ago

@JanKolk Ocelot doesnt support this at the moment. I guess it would be part of #344 I will move the data to that and close this as a duplicate!