Comments (6)
I've been delving into this today, and the conclusion I've come to is that the context.RequestAborted cancellation token is getting canceled, which means the request is getting aborted, right?
The request is getting aborted before the socket is even created, it looks like to me, but I have no idea why. I'll keep examining this to see if I can get anywhere.
from citadelcore.
@kfreezen If that cancellation token is being flagged/set then it's being done by the internal processing of kestrel itself. I'd be curious to know why kestrel would be aborting the connection. Maybe timeout? I have not had a chance to look at this stuff yet because I've had a nagging problem in some server side code of mine draining all of my time this week. I'm going to crack into this stuff over the weekend though.
from citadelcore.
I've finally figured out where the problem lies, and it's not pretty.
In FilterWebsocketHandler.cs at line 64ish, we have
await context.WebSockets.AcceptWebSocketAsync();
cad.onshape.com sets a Sec-WebSocket-Protocol
and expects a matching protocol header back from us. When no such header is returned, the browser aborts the connection, therefore causing the problem I was observing.
As far as I can tell, there is no way to force ASP.NET/Kestrel to return a matching protocol to the client browser on acceptance of the websocket connection.
The only fix I can come up with is adding a method to do what we want to ASP.NET Core's code, issuing a PR, and hoping it gets accepted.
from citadelcore.
@kfreezen Yikes. Well, there's probably exposed mechanisms buried in kestrel where we could handle it. First thing I'd check is to see if it's possible to build a connection handler like I did for handling HTTPS. You can get hold of the connection before kestrel does anything to it through an exposed interface. Might be a solution there. Worst case scenario you could do some reflection based hacks I guess to patch it.
from citadelcore.
@kfreezen Nope the solution is to reply with the server-selected subprocotol inline in the AcceptWebSocketAsync(... subproto here...)
call.
What should be done though first is to establish the upstream client websocket connection, forward the Sec-WebSocket-Protocol
header in that client connection, get the upstream server's selected protocol from the handshake result, and then pass that subprotocol to AcceptWebSocketAsync(...)
to make sure we don't screw anything up acting as an invisible proxy.
from citadelcore.
wss://websocket.us.fleetmatics.com is not loading on https://reveal.fleetmatics.com/report/
Also a report of avery.com not working.
from citadelcore.
Related Issues (20)
- We need to clear headers before applying user-generated headers
- Possible bug where 0-length responses screw up and actually include a body HOT 2
- HttpMessageInfo.StatusCode wrong value HOT 1
- Body for blocked page not shown HOT 12
- HttpMessageInfo needs to have a property that indicates the HTTP version HOT 1
- Document that the user must specifically set the message info message type HOT 1
- Can not access Facebook HOT 30
- Change error callback to include exception object
- HTTPS exception on TlsSniConnectionAdapter.cs::InnerOnConnectionAsync() HOT 29
- Perform a new coverity test HOT 1
- Overriding async io in InspectionStream causes duplicate data sent to feedbacks HOT 1
- Change configuration constructor
- Make blocking of SOCKS4/5/TOR a configuration variable, rather than compile-time condition HOT 1
- New websock system fails because new headers need to be blacklisted
- Is it possible to modify response body? HOT 3
- Add null checks for SNI extensions object HOT 1
- websocket based handler throwing multiple exceptions with Facebook HOT 9
- Support for Windivert 2.0 HOT 11
- Error when upload file to Google Drive HOT 2
- when I tested CitadelCore.Windows and got the traffic error as described HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citadelcore.