Configure Vert.x proxy for Firefox - firefox

I would like to run a verticle at port 8080 on the localhost so that when I configure Firefox to use http://localhost:8080 as proxy, it will connect to the verticle and I should be able to get the URL that was requested.
In other words, whatever URL I type in my address bar(say www.google.com), that should be available in the verticle. My ultimate aim is to get the html at the URL, inject some script of my own and serve it up to the user.
Currently when I run a server at 8080 Firefox simply responds that Server didn't respond.
Also I am unable to println anything when I type a URL(like google.com) which seems to suggest a connection was never made. Instead when I type localhost:8080 I get a proper response as well as the absoluteURL.

Odd.. If you run the proxy example in the vertx-examples repository:
https://github.com/vert-x/vertx-examples/blob/master/src/raw/groovy/proxy/Server.groovy
That starts the proxy on port 8282. If you then go into the Firefox preferences:
Preferences -> Network -> Connection Settings
And set the HTTP Proxy to localhost, the port to 8282 and check the checkbox Use this proxy server for all protocols
Then typing google.com into the address bar should show logging in the terminal window, and the browser should display:
server-data-chunk-0server-data-chunk-1server-data-chunk-2server-data-chunk-3ser‌​ver-data-chunk-4server-data-chunk-5server-data-chunk-6server-data-chunk-7server-d‌​ata-chunk-8server-data-chunk-9
Maybe it's cached something in the browser? Try clearing the caches before navigating to google?

Related

Unable to capture traffic on proxy port for http url

I am running a Groovy script to capture traffic over proxy port in OWASP ZAP.
For https site, I am setting the proxy as given below and I can see the traffic in ZAP when I run my script.
System.setProperty('https.proxyPort', '8083')
System.setProperty('https.proxyHost', '127.0.0.1')
For http site, I am setting the proxy as given below but I can not see the traffic.
System.setProperty('http.proxyPort', '8083')
System.setProperty('http.proxyHost', '127.0.0.1')
The same settings although work fine when configured on Chrome. I have tried using the IP address instead of 127.0.0.1 but that also did not help. What could be going on wrong here ?

binding rethinkdb webUI to 'localhost' and proxy: refuses connections or exposes to full network

I am not able to successfully bind and secure the rethinkdb http client, either being exposed to the whole network or refusing connections behind the proxy.
I am thus left with no choice but to restart the rdb daemon with bind-http=all each
time I want to access it...
Rdb starts with systemctl under archlinux. Three configurations I tried:
# /etc/rethinkdb/instances.d/mydb.conf
bind-http=localhost #(1)
bind-http=127.0.0.1 #(2)
bind-http=1.2.3.4 #(3)
Resulting in:
Fails to parse 'localhost'
Refuses connections behind the proxy
Equivalent to bind-http=all
Firefox 59 uses a socks proxy, working ok
as the browser's ip address does become 1.2.3.4:
$ ssh -TND 8080 user#1.2.3.4
I am quite convinced that I had secured the http client as expected,
and problems started after I updated both FF and rdb
(FF59 fails to parse 'localhost' as well for example)
I don't know if this is a bug or a feature or if I am missing something,
any help is most welcome. Many thanks
Beware of the "localhost" string.
Configuring the rethinkdb server with:
#/etc/rethinkdb/instances.d/mydb.conf
bind-http=127.0.0.1
http-port=8084
and binding some local port with SSH:
[client]$ ssh -L 8080:127.0.0.1:8084 server
is enough to access the web interface at 127.0.0.1:8080, as suggested by #jishi.
Configuring the browser to use a SOCKS proxy as per the rdb docs is not at all necessary.
For some reason localhost:8080 is not understood by FF59 (gets invisibly prefixed by www or something).

Changing web to https

I am trying to change my site to https (port 443). Everything works correctly except for one thing, on my site i'm using a service call Yawcam which allows to stream a webcam (I'm using port 8081 to that end).
It is working when I use for my Apache server port 80 (http://myip:8081), but when using port 443 it doesn't respond (https://myip:8081).
All ports mentioned are opened to Public (80,443,8081) through my Windows Server firewall.
I'm out of ideas, do you have any?
This is nothing to do with your firewall, this is to do with the fact that you are using mixed content.
Chances are you are using http:// for the external service and this will be blocked by browsers as they do not like it when you try to load a less secure resource than the loaded page.
Try changing your external content URLs to https:// if possible.
You can see here for a little more info on what you could try: https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content

JMeter recording for browser less application

My web application doesn't uses browser. It is a MS Word plugin and uses port 80.
When I try to record on port 80, Jmeter says 'port already in use'
And if i set other port in my app, app doesn't work properly.
What to do in this case??
Thanks
If your MS Word Plugin has proxy settings - configure it to use JMeter's Proxy.
If it doesn't have its own proxy settings - it should respect system proxy configuration (usually it can be configured via Internet Explorer proxy settings)
You can use 3rd-party tool like Wireshark or Fiddler to capture the traffic and convert it to JMeter .jmx script.
The only way you can do it as I see it is not through script recording but by setting requests in jMeter manually and build whole test plan like this. It's not so hard anyway if you know how your plugin works and requests you send. Some short info can be find here:
http://jmeter.apache.org/usermanual/build-web-test-plan.html
Error message 'port already in use' means that port 80 was assinged to some other service. You can't assign that port to Jmeter proxy server to start. (Jmeter has to start its own service on some unused port)
a. Just start Jmeter on its default port 8080 (or some other unused port).
b. Redirect required traffic to Jmeter proxy port (i.e, 8080). MS office will honor System proxy settings, so change the IE proxy setting to server '127.0.0.1' port '8080', it should automatically apply to office.
c. Now all the HTTP requests trigger from Office should visible in Jmeter Proxy recorder. After that you can move them to required location in Test Plan.
As Dmitri Said, you can also use Fiddler to track the requests (Prefer Fiddler over Wireshark, for its ease of use).
Good Luck!

Using Fiddler to debug the Windows Phone 7 emulator

I recently started using the updated beta tools for Windows Phone 7 and ran into an interesting problem. It seems that with Fiddler running, any Http requests run through the emulator start returning a null result and create a "not found" web exception. This is easy to reproduce with WebClient.DownloadStringAsync(). The old versions of the emulator did work with Fiddler if I remember correctly. Has anyone had luck getting the two to work together? If it's not possible I'd be open to any other tool that could help debug web requests from the WP7 emulator.
It looks like there is a blog post that describes getting fiddler working with Win Phone 7 through some customized rules for setting up Fiddler as a Reverse Proxy.
Here is a little bit of the instructions from the fiddler website, but the blog post seems a little clearer (sorry for wacky format, the block quote is not cooperating):
Option #1: Configure Fiddler as a
Reverse-Proxy Fiddler can be
configured so that any traffic sent to
http://127.0.0.1:8888 is automatically
sent to a different port on the same
machine. To set this configuration:
Start REGEDIT Create a new DWORD named
ReverseProxyForPort inside
HKCU\SOFTWARE\Microsoft\Fiddler
Set the DWORD to the local port you'd like
to re-route inbound traffic to
(generally port 80 for a standard HTTP
server) Restart Fiddler Navigate your
browser to http://127.0.0.1:8888
Option #2: Write a FiddlerScript rule
Alternatively, you can write a rule
that does the same thing.
Say you're running a website on port
80 of a machine named WEBSERVER.
You're connecting to the website using
Internet Explorer Mobile Edition on a
Windows SmartPhone device for which
you cannot configure the web proxy.
You want to capture the traffic from
the phone and the server's response.
Start Fiddler on the WEBSERVER
machine, running on the default port
of 8888. Click Tools | Fiddler
Options, and ensure the "Allow remote
clients to connect" checkbox is
checked. Restart if needed. Choose
Rules | Customize Rules. Inside the
OnBeforeRequest handler, add a new
line of code: if
(oSession.host.toLowerCase() ==
"webserver:8888") oSession.host =
"webserver:80"; On the SmartPhone,
navigate to http://webserver:8888
Requests from the SmartPhone will
appear in Fiddler. The requests are
forwarded from port 8888 to port 80
where the webserver is running. The
responses are sent back through
Fiddler to the SmartPhone, which has
no idea that the content originally
came from port 80.
I'm not able to get Fiddler to monitor the traffic, so I use WireShark, which works fine.

Resources