How to Sniff signalR calls using chrome Developer Tools - signalr

I download Jabbar chat website and ran it in chrome. I wanted to see what all is happening between browser and server and for that check the network tab. However, I see no entry in network tab (neither xHr not websocket or anything else) but SignalR is working fine. It does sends and receive message. I wonder what is signalR using that developer tools is not able to log. Is there a setting required in developer tools?

Nowadays when your signalR is using WebSockets it is a bit different. Starting with Chrome 58 you have to click on the Network tab and then activate the WS filter. There will be one entry when the signalR connection has been established. Now click on the Frames sub-tab. Here you see every message which has been received by the browser:

You should turn on client-side logging so you know which transport type you're dealing with ($.connection.hub.logging = true;). In case of long-polling, you should see the XHR calls in the network tab. In case of a websocket connection, you should be able to see the frames when choosing the "WebSockets" filter on the bottom, then clicking on the connection entry, then selecting the "Frames" tab. This won't auto-refresh, unfortunately, so you'll have to click on the connection entry in the left whenever you need an update.
If that's not good enough, you'll probably have to look elsewhere (Wireshark, Fiddler, etc.)

Related

How can I capture data send to a webserver/website?

What is an easy way to capture data send to a webserver?
I want to get the code, which gets send when I give someone reputation on a forum...
Try Fiddler. It acts as a system-wide proxy and captures all http requests and provides a way to inspect them.
If the data is sent using a browser.
You can monitor the traffic using Firebug in firefox or Developer Console in Chrome.

What does "connecting" mean in Chrome Developer Tools in the Network Tab, and why does it show up only for some sites?

I've been trying to look for an explanation online but I can't seem to find one.
If you go to a site like youtube.com on Chrome and hover over the blue bar corresponding to the file name "http://www.youtube.com/", you'll see four different things:
-Blocking
-Sending
-Waiting
-Receiving
While viewing a different site's page in the network tab, I see
-DNS Lookup
-Connecting
-Sending
-Waiting
-Receiving
It takes a long time to do all these things, even though the page is so simple. What makes my server display different statistical keys for a page load, and what can I do to optimize? In general, where can I find more comprehensive info on network tool?
DNS lookup usually happens when you connect to the site the first time and your browser doesn't have its ip address. In this case you can see a small tooltip at the down left corner of the page with text "Resolve www.blablabla.com...."
It could be pretty long if the DNS server is slow.
Connecting is the time when the browser has sent a packet for establishing the connection and is waiting for an answer.
It can be long if the web server is slow.
Blocking is the time when the browser has to request a resource but 20 other resources have been requested from the same server. In this case the browser will put these request into a queue. It can happens if the server is slow.

Is there a way to discover the specific HTTP requests my browser sends while I navigate?

The question is pretty straightforward. I want to know if there are ways of discovering the HTTP requests my browser sends while I navigate. For instance, what happens when I click on a certain link which sends a PUT method? I mean, I wish I could determine the exact HTTP request that my browser sends to that website. Further, I want to, later, reproduce that request on Curl. Basically, I want to inspect requests my browser sends so I can automate that task later through the Curl command (command, not library).
Thanks in advance!
Fernando.
Fiddler does exactly what you want. It sets up a proxy that can monitor http communication from your browser.
http://www.fiddler2.com/fiddler2/
You would want the Firebug extesion for Firefox. It can show a lot of what is happening, and you can add more options by installing more extensions.
On the other hand, you can use wireshark to capture the traffic to and from your computer.
Then you can use filters to save the relevant packets (pcap is often the format for storing the packets).
Later, you can replay the packets using tools like tcpreplay.
You could try it out with backtrack linux (live cd/usb).
And nowadays there should be some new tools for windows also. :)
EO2 and JohnnyC are correct. Fiddler, WireShark, FireBug (FireFox addon), etc. are what you are going to look for. You can use them free of charge.
WireShark will capture all incoming and outgoing traffic on your box. You can listen on any port, filter data etc.
FireBug will capture outgoing and incoming data streams, the raw data (XML, JSON, images etc.) for each request.
Fiddler is great for tracking web data in a seperate application if you do not use FireFox.

http response message

I want to know that when browser sends a request do the server sends back the contents explicitly? And how would i confirm it?
There are several toolbars in Firefox that show exactly what are coming and going when making an HTTP request.
For firefox i use the following plugins:
Firebug
Web Developer
You could also install a utility called WireShark. It will "sniff" all the network traffic on your computer and show you at a packet level how it all works.
Browser plugins such as firebug (for firefox) let you see exactly what the server is returning; that's quite instructive and recommended! You'll see a bunch of headers followed by the response body in any of several formats (could be chunked, etc, etc).
In a Windows environment you can use Fiddler.
Fiddler includes a fair amount of documentation and is easy to use.

What TCP protocols are usable for client to client communication?

Manytimes clients ask for features like instant messaging (IM) and other client-to-client (P2P) communication for their web apps. Typically how is this done in normal web browsers? For example I've seen demos of Google Wave (and Gmail) that are able to IM from a regular browser. Is this via HTTP? Or does XmlHttpRequest (AJAX) provide the necessary backend for such communication?
More than anything I wonder how can a server "wake up" the remote client, lets say for sending an IM? Or does the client have to keep "polling" the message server for new IMs?
Typically the browser will poll the server for new messages. One approach that is often done to make this more efficient is the 'long poll' (see also this link) - the server responds immediately if it has anything; otherwise, it waits, keeping the connection open for a while. If a message comes in, it immediately wakes up and sends it, otherwise it comes back with a 'nope, check back' after a few tens of seconds. The client them immediately redials to go back into the long-polling state.

Resources