I tried using Muffin's web proxy to record the url's that were hit in the browser.
I am able to track the internet request like google.com,stackoverflow etc.,
But, was unable to track the intranet request like the one which does not need internet. I am not sure how intranet works because those request for the url were not being tracked.
Is there a way to track those request as well(intranet urls).
1) I am able to track the weburls because i am redirecting all the request to the socket i had created in java.But setting it up as a proxy in the settings.
2) Usually intranet sites do not rely on the proxy servers. it will directly communicate though dns server.How to make those request also to go through my socket ?
Note I am trying to achieve it using JAVA sockets.
Use a windows application called FIDDLER.... It can track all type of inbound and outbound connections...
Related
I am developing a web service and a client for it. I want to get the client information from the request in the web service's code. For example, I can fetch the client IP from its HTTP request.
Is there any other parameter (like client application name) of a client except IP or client hostname which I can fetch in a web service's code? I can add any configuration in the servers to pass parameters also. I am open all solutions.
Thanks
Thank you for your answer. Actually, i am searching a solution using configurations without any code changing in client side. Solution can be a lower level of OSI or it can be a change in the servers conf. I will apply the solution for a huge system after all. I am just trying with one client and one service now. But actually in the system there are 1500 clients+services. So i don't want to change code in client side.
I am trying to block certain websites using a web application. So, when a I type a url suppose "http://www.google.com" it should first check whether google is blocked by my application or not. If not open the website otherwise reject the browser request to open it. I am unable to find a way to capture all HTTP request from browser so that I can process it.
I Know proxies are the most suitable option but is there any alternative solution to this. After some searching I found a library - jpcap (a network packet capture library) and I was wondering if this could help me or not?
What you are trying to create is a proxy-server.
You have to configure the browser to go through the proxy, then you can deny websites, reroute them etc.
There are many proxies already there (open source and commercial) that offer what you want.
For example: Squid http://www.squid-cache.org/
See Wikipedia description of a proxy here: https://en.wikipedia.org/wiki/Proxy_server
Many firewall products offer the service of a transparent proxy, redirecting all http/https traffic going through the firewall into a proxy server. It seems, you have a direct connection but your packages are really filtered. Aka transparent proxy.
If your assignment does not allow this context, you need to check the assignment again, if you really got the scope of filtering right.
You cannot take over the browser's ip communication from a servlet or servlet filter. Using a (servlet) filter, you can only filter requests directed to your application. One step above, using an application server valve (Tomcat uses this term, others may use a different one), you can only filter requests directed at that server. One step above (or below) your application server is the physical server and the network it is running in.
If your client does not share the same network as your server, you can't even apply transparent proxy to it. Since browsers are running on the client computer, most clients in the world do not share the same network zone as the server.
It just does not work as you expect it.
I have a GWT appilcation in which the client makes a request to another domain.
I wrote the request using RequestBuilder in GWT.
On executing the code, I get an error in my browser :
No 'Access-Control-Allow-Origin' header is present on the requested resource.
So I google and I found that the domain to which I am making the request should add this header in the response that it sends. Now I dont't have control over the other domain's server, so I can't do any modification there.
My question is, can I intercept the response and the Access-Control-Allow-Origin header to the response that is being sent by the other domain's server at my server, before I send it to my client?
I tried using Filters but the Filter doesn't get called for responses coming from another domain.
Is this possible to do, am I missing something or is it just not possible?
Vivek's answer that cross domain requests aren't allowed by the browser is true, except for the CORS mechanism, whereby newer browsers that support it can try in a cross origin way to servers that also support it.
However, unless that remote server support it itself, there is nothing you can do. If I server my app from A, and want to connect to B, only B can authorize that. If A were allowed to permit my app to connect to B via some filter or servlet, then I could write an app that makes calls to gmail or facebook or twitter and read/write your settings and personal data at those other urls.
So instead, it is the cross origin server that you are contacting that must approve the connection with the header you mentioned. In lieu of that, you can still use your own server as a proxy for the cross origin server.
Cross-domain requests are forbidden by web browsers as per the same origin security policy. These restrictions are limited to browser based applications and hence you can definitely use your own server application as a filter between the GWT based client side application and the external server.
I enabled channel presence in google app engine, so I get a "ping" whenever a client connects/disconnects a channel. This is great! However, it's not enough. I would like additional information. For example: which page the client is on (i.e., the uri the client sees), or additional JS variables.
I didn't find any mention of this on google's tutorials. How do I do this, and is it even possible?
Thanks!
It's not possible for technical reasons -- the server generating those requests has no knowledge of the state of the client. If you want that data for connect, though, you could manually POST (to a different URL) when you get the onopen callback.
I 'm getting 620 error response codes back from the google maps geocoding api if i send the request directly from my app engine servlet, so i have no choice but to use a proxy to receive a successful response. I set up a proxy server, and ive tested it from several computers. Now, all I want to do is make a url request from my GAE servlet through my proxy.
I've tried every possible solution out there and none of them work....
-java.net.Proxy isnt supported in the app engine runtime...
-setting properties as follows:
Properties props = System.getProperties();
props.put("http.proxyHost", "proxyhostname");
props.put("http.proxyPort", "proxyhostport");
didnt do anything.
What is the easiest way to send an http GET via a proxy in app engine?
It seems like this is not possible: Google's App Engine APIs don't support it. Using a third-party library (like Apache's HTTPCore/HTTPClient) or writing it yourself is not possible because essential network classes like java.net.Socket are not whitelisted.
Not sure why you can't access the Google Map API, but if that really does not work, your only choice is to write some application on your proxy server that responds to normal HTTP requests and then forwards them to Google Maps.
Update: Googled a bit, seems like a well-known problem: the Map API has a limit of 2500 requests per day and IP, and this is limit is reached quickly on GAE where you share your IP with many other applications. The only thing you can do is move the requests to the client, use some proxy with own IP, or use a different service.