I need to test the over head on my WebSocket application. How to test it and see the results?
If you use Fiddler you can track all the communication between your browser and the server using WebSockets. (look in the log section).
This should allow you to get a feel for exactly what the communication looks like, including whatever you have defined as "overhead".
I find the WebSocket pane in Google Chrome's Developer Tools to be great for measuring and debugging WebSocket traffic.
Related
I have spent a lot of time browsing for a solution to my problem: I am testing an Android app and will be testing the same app on iOS too very soon, using Appium and C#. My app receives response from the server, which I would want to go through a proxy so that I can sniff as part of my NUnit test to ensure that the response returned from the server is correct and compare it with the response I receive on the app (through SDK).
I understand I can use BrowserMob (using Automated Tester C# library) to do this on desktop browsers using Selenium but I cant find any info for doing this using Appium.
1. Firstly, is it possible to sniff network traffic going to the mobile app?
2. Are there any other possibilities that I should consider to achieve my goal?
I want the response to pass through the proxy so that I can assert my tests at run time. Please help/suggest.
U can try burp proxy or Charles proxy to sniff the requests through the mobile
I was able to do this using FiddlerCore library. A lot of usage documentation can be found here: Rick Stahl's web log
Configured fiddlerCore to constantly listen on port 8888 and loop back address and starts running when my test is started and interecepts the traffic going to or coming from the server.
i need an open source app (c# or c++ ) that grab all windows http traffic and forward to an http proxy
there is an app name Proxifier do this but i want open source project to embed to my app or at least a free commandline program that do this
thanks so much
You can use Fiddler2 to first intercept web traffic and force it to your own proxy.
Tools > Options > Gateway and set your proxy.
Or consume FiddlerCore in your own app.
Commandline wise I can recommend proxychains.
http://proxychains.sourceforge.net/
For a full blown proxying solution you might want to look into Privoxy.
http://www.privoxy.org/
There is also squid proxy for instance and many other solutions. The solutions I mentioned are rather unix/linux centric so you might need cygwin or similar to drive this.
The last time I needed something like this I used the mentalis proxy, which has a BSD style license.
I've some fishy application that makes HTTP requests to a website, i would like to intersect that request and send other data to the server. Is that possible in C#,java or C++?
EDIT: The application isn't mine, i just know the endpoint that it sends http requests
Fiddler might provide the functionality you need. At the very least it may enable you to see what is being sent to the web site.
in Java You can intercept request from Filter
You may want to look into using an HttpModule, whose purpose is to intercept incoming HTTP requests.
The ASP Column: HTTP Modules
Firstly are you aware of how it is connecting to the internet? For example, is it using the settings from Internet Explorer, or is it establishing a direct connection? If the latter, this may be tricky, there is no direct port forwarding as there in Linux, so you'll need some third-party tools to redirect the traffic to a server (which you can write in Java, C++ or C#, I would go for C# if you know it for pure speed of development) In that server you can intercept the request, and then create your own to actually send to the real destination.
Sounds like a cludge, but I think you're stuck with this approach due to the lack of direct port forwarding. You'll have to configure the third-party tool that you use to forward someother well known port to 80, and your server should write to this.
I want to check which web sites is open in browsers ( IE, Firefox, Chrome ) to write a program in C# which can block web site which is in list of forbidden web site. Is there some API of browsers?
The better solution can be to write a TCP/IP filter, like most firewalls do.
UPD: this topic can be relevant: How do I hook the TCP stack in Windows to sniff and modify packets?
There is no generic "browser API" that allows access to this kind of information across all browsers.
I'm pretty sure the idea of doing this by accessing the browsers is doomed from the start. It is going to be almost impossible to implement, require frequent updates, and always extremely easy to circumvent (there are dozens and dozens of browsers that your program will not know.).
The only reliable way is to filter traffic on network level. I would recommend looking into using an existing proxy server or TCP filtering program. There are several Open Source ones that I'm sure you can use as a basis to rewrite or hook into.
The easier solution is to write an http listener that logs the requests.
Fiddler2 is one of these, you can check it out. it logs all incomming and outcomming http content.
I have this question https://stackoverflow.com/questions/2688464/ajax-request-from-net-give-me-unexpected-results
and i am using tamper data but i am sure firefox is formatting the data in ways i dont understand. Is there a tool i can use to check firefox post request? and perhaps my C# post request?
Recommend you download the Firebug plugin for Firefox, this will allow you to debug on the browser side more easily.
Also take a look at Wireshark (or similar) to inspect the HTTP requests that are actually going out onto the network.
Fiddler is a widely used web proxy/debugger - you can easily see incoming and outgoing requests with it. It can be used with all browsers.