C# Nugget Server Error - html

I'm currently trying to get a simple client \ server websocket demo up and running and I'm trying to use the C# Nugget project as my server. I can connect to the server through Netscape (v5.1.4) but not through Chrome (v18.0.1) and I've tracked the issue down to the client handshake.
Nugget expects the client handshake to be in the following format which is exactly how Netscape is sending it:
Chrome's client handshake on the other hand is looking like this:
I've highlighted the differences in the two requests that are causing the problem in Nugget server - the sec-websocket parameters.
I'm guessing that Netscape and Chromes implementation of the client handshake are based on different versions of the websocket specification. Has anyone got any more information on this? Is it OK to just add code to handle both types of handshake or is one deprecated?
Any insights welcome,
James
Resources: Understanding Websocket Client Handshakes

It looks like Netscape is speaking the older, deprecated, Hixie variant of the protocol. Safari also uses this. Chrome uses the more modern RFC 6455. You can expect all browsers to use RFC 6455 eventually.
Assuming you want to support as many client types as possible, its okay (indeed correct) to add code to handle both variants. Note that the data framing for post-handshake reads/writes also changes depending on the protocol variant being used.

Related

Why does Google Chrome generate 2 types of client hello message

I'm analyzing google chrome TLS client hello messages and I found that google chrome generate 2 types of fingerprints. One withe GREASE extensions and one without. I want to know why google chrome generate 2 types of client hello messages and based on what it send each time a type?
Please I need help
In the past TLS implementations in servers and middleboxes often relied too much on behavior they've seen instead of behavior as standardized. This resulted in broken TLS handshakes when new ciphers or extensions were added. This was then worked around in clients by downgrading to older "known good" behavior by downgrading the TLS protocol version or not offering newer ciphers etc. Given that typical client successfully worked around broken systems there was no actual incentive to fix these systems.
Based on the market penetration and control Google has with its Chrome browser they've decided to tackle this problem in a more active way: on the one side they've nagged vendors to fix their implementations and on the other side they added some unpredictable "grease" to their clients so that system designers could not longer rely on a specific behavior but were forced to actually read and implement standards instead.
It looks like this grease is not done for all requests but only for a subset. And also different values for grease are used so that peer implementations cannot rely on a deterministic behavior. This matches what is described in Applying Generate Random Extensions And Sustain Extensibility (GREASE) to TLS Extensibility - RFC 8701.

What do you mean by ''Exposing a JSON"

Just came across a person telling one of my colleagues to use jetty with his project and expose a JSON. Just curious about what it means. I searched the internet but found nothing. So what does it mean to expose a JSON?
As far as I understand, jetty is simply just another http server just like Tomcat etc. How is jetty different and how would it be used to expose a JSON?
Jetty is just a server like Apache's Tomcat or any other.
Since nobody has posted an answer on this, Exposing a JSON merely means receiving the response from a certain webpage (using the getmethod) in the form of a JSON. This could also be XML for people who would prefer that.
Browsers like Chrome and Firefox provide plugins that can be used for the same.
For Chrome, one such plugin is Postman. Can be added to your browser simply by going to the Chrome Web Store and searching for the same.
Hope this helps!

Locate answer SDP packet in Wireshark

I'm tracing packets between 2 agents. One is from Chrome on Mac, the other is from Chrome Beta on Android. They're communicating by a reference site like apprtc.appspot.com and I managed to save some logs out of it. (please download it or it only displayed as source code) Doing so I also capture packets in Wireshark while 2 agents communicating with WebRTC.
Using filter: stun||udp lots of Binding requests & responses can be founded.
Basically from the rfc doc it said:
An agent can respond to an initial offer at any point while gathering candidates...
thus allowing the remote party to also start forming checklists and performing
connectivity checks.
But I just can't see any sign of SDP like offer or answer sending to each other, which can be found in js log above. For cross reference I hope to find the right order of the entire communication.
Here's the Wireshark file kinda of big
Chrome uses TLS to encrypt the signaling packets. And if its a communication directly between the peer, the only way to see signaling is looking at the Console logs of chrome. It should have the offer answer exchange of the SDP. I am assuming its using SIP as the signaling protocol and you should be seeing it in the console.
If there is a intermediary between the peer, like a FreeSwitch any other SIP Server, it could be possible to debug it better as they have the keys to decode and find use the raw text messages.

Can't get SignalR, CORS and Server-Sent Events to work together

I have a SignalR 2.0 server hosted in IIS7 with a javascript client, targeting mainly Chrome browsers at the moment.
Without cross-domain, the SignalR transport is Server Sent Events, which works very nicely and is efficient.
I added CORS support to the server in the suggested fashion, using Microsoft.Owin.Cors -- that makes the server work with the client cross domain-- however, the SignalR transport is now long-polling; this is going to cause a much higher load on my servers, as the SignalR messages from the server to the client are quite frequent.
I'd really like to get Server-Sent Events and CORS support working together, and from my understanding of the protocols I don't see a reason why it can't be done. Any suggestions? Anyone have any luck in the same scenario with other browsers?
SignalR currently doesn't try to establish cross-domain SSE connections by default.
This decision was made before browsers had CORS compatible EventSource implementations, so it was seen as wasteful to even attempt establishing cross-domain SSE connections.
Starting with SignalR 2.0.3, cross-domain SSE connections will be attempted by default.
In the meantime you can manually specify which transports to try and what order to try them in:
$.connection.hub.start({transport: ["webSockets", "serverSentEvents", "foreverFrame", "longPolling"]});
http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client#transport

Websockets - force protocol

I am having problems getting Chromium/Firefox to handshake with my node.js install since they both use the hybi10 protocol now (which node WebSocket apparently doesn't support yet).
Am I right in thinking that doing...
new WebSocket( 'ws://127.0.0.1:8000','draft-ietf-hybi-00' );
... should force the browser to use an older protocol? It doesn't seem to solve my problem
No. The second argument is a sub-protocol and not related to the version of the WebSocket protocol being used by the browser. Each browser implements a single version of the WebSocket protocol. Servers often implement support for multiple protocol versions.
Perhaps the Node 'ws' module might work for you. There is also Socket.IO which is higher level communication library that uses WebSockets if it can but includes fallbacks if the WebSocket transport is not available.