Closed OnSive closed 1 year ago
Well...
When I send a ws request to the Blazor Server Side Get the remote ip address on http and ws request
Are you saying about Websockets requests? Websockets feature?
Remote ip address is ::1 on http and "real" on ws.
Yeah, you see such facts because of different protocols, and they behave differently. Don't you ask us, as Ocelot team, to fix that? 🤣
"DownstreamHostAndPorts": [ { "Host": "localhost", // come on! "Port": 5000 } ],
You use localhost
and local environment PC to host the solution, and you wonder why do you have localhost addresses?
Come on!
What is your upstream settings in global section? I mean this:
"GlobalConfiguration": {
"BaseUrl": "somehost:someport"
}
I guess, BaseUrl is also localhost
, right? 😉
IpForwardHandler : DelegatingHandler
Why do you write special delegating handler to get remote address IP? It seems you didn't read the documentation...
I don't see the issue! I'm going to convert to a discussion...
When I send a ws request to the Blazor Server Side then I get the real remote IP address of the remote device, but when the request is a http request to the Rest API then the remote IP is
::1
.Since I cannot test the application on a server without considerable effort, I wonder if it could have to do with the debug environment.
Expected Behavior
Get the remote ip address on http and ws request
Actual Behavior
Remote ip address is
::1
on http and "real" on ws.Specifications
Configs:
ocelot.json
IpForwardHandler : DelegatingHandler
Additional question
What would be a feasible way to forward the remote ip address? as the:
Configuration does not seem to do anything. (at least not in the ASP.NET backend)