How to trace a webrequest created in code sent to a local address - debugging

This issue is occurring in a C#, .NET 4.0 environment. I tried using Fiddler but it doesn't show up. After searching around, the suggested solution was to change the address of the request from localhost to the machine-name.
This worked on my local machine: after changing the call from localhost to my-machine, fiddler picked it up. The real issue is on a client's staging environment with production code. I can not modify the code there to take this change.
Note, as far as I know, on the client site it should be making the request out to the host name and not localhost anyways.
Also, on my local machine I actually hit localhost in my browser, and it seems to pick those up fine. Just not the request built in code. Why is that?
Thanks!

It sounds like you're saying: "This works fine on the client's PC but not on my dev PC when using Localhost." Is that correct?
In IE9, I changed WinINET to enable Fiddler to capture loopback traffic from the browser. Sadly, the .NET Framework hasn't yet adopted support for the <-loopback> token, which means that traffic sent to 127.0.0.1 or localhost bypasses the proxy.

Related

how to port forward an https website

I have recently got an SSL certificate on my website, on the apache server that I am using to host my website. The website says "Secure" and also works fine when I run it over localhost using the laptops ip address 192.168.*.**. But when I try to port forward this website over the port 443, it somehow says unsecure and your connection is not private. Any help here will be appreciated.
It sounds like you are using a self-signed certificate for your https connection. While modern browsers such as chrome give you errors saying the connection is unsecure and perhaps you even see red lines crossing out the https at the beginning of your url, there is no need to worry. If you are getting your page to render with these characteristics all is working, the reason for the errors is because the certificate is signed only for you.
In a real world production scenario you would have to use a third party service for a public capable certificate. However for your own development purposes, as long as the page runs with https there all is working as it is intended to.
For more try reading this article.

GhostLab website On Mobile Fails To Ping Other Locally Hosted Site Via AJAX

Testing out Ghostlab on mobile presented an issue when the locally hosted page attempts to ping another locally hosted page via AJAX. Normally, GhostLab will rewrite the URL for you, but since it's an AJAX request I'm assuming it's not rewriting it because it's a dynamically generated URL.
Works fine on virtual machines and host machine with modified HOST file. Fails to load AJAX. The proxy server settings are very limited on GhostLab. Has anyone come across this issue and solved it?
The solution is to run another proxy server because you can't really modify the HOST file on iPhones or Androids without a huge headache.
I ended up using Charles Proxy. I remapped the locally hosted URL to which it was making the AJAX call to my local machine and it fixed everything. Here are the instructions:
1) Open Charles
2) (Menu)Tools/Map Remote...
Add the url you are local hosting to remap any traffic going through Charles Proxy to go to your machine See image example:
Do the same to any other subdomains or domains that are locally hosted on your machine and remap them too.
3) On your mobile device, open settings and select your local Wifi Network.
4) Change the proxy to your machine's IP address and relevant PORT.
5) Attempt to access the website and Grant permission via Charles.
This should fix it all.

Can't browse local domains without a network connection

I have a few different PHP sites running on local domains (i.e. domains set to 127.0.0.1 in /etc/hosts) so I can work on them without any network delay.
I'd like to be able to work on these sites when I have no connection at all (e.g. on the bus or in the park) but my browser (Firefox on LinuxMint) can't load the local pages when there's no network connection (it doesn't have to have Internet access, but it must have a working network connection). Note that it can load a site via local IP addresses or "localhost", but not using any other local domain name.
I'd like to create some kind of local network that makes the Network Manager show a valid connection even when there is no LAN adapter present. Or alternatively a way to make Firefox work with the local domains without needing the network would be just as good.
Reproduce this problem as follows:
- Run a local web-server such as micro_httpd and serve a test site
- Set up some other names for 127.0.0.1 in addition to localhost in your /etc/hosts file such as foo.bar
- Test that your site works from localhost and from foo.bar
- Unplug your network cable
- Test again, only localhost works, not foo.bar
- Test with wget, both work fine
I have the same issue. Either of these work for me, in Firefox go to about:config and click I'll be careful, I promise!, search for network.dns then either:
Set network.dns.disableIPv6 to false
or
Add your local domain names to network.dns.localDomains
I think the latter is probably the better of the two options, but either works for me.
Adding a little to Lee Kowalkowski answer:
I have modified below at admin:config in my firefox developer edition 61.0b3 (64-bit)
network.dns.localDomains added localhost as I bind my local sites with localhost
I haven't needed this functionality for a couple years and noticed now as of Firefox 60 that there is no problem any more.
This old Bugzilla thread mentions the issue and says it was resolved by adding the about:config key network.dns.offline-localhost, perhaps that's set to true by default now which is why it works?

Local URL IP redirect via port

I do a lot of custom web development and I am looking for a solution to a problem with testing.
I have a local development server that I run sandboxed environments on. When I need to test something I sometimes will edit my host file to make the domain point at my local IP
In my host file I would have.
127.0.0.1 mydomainname.com
What I would rather be able to setup is if I added a port to a URL:
mydomainname.com:7777
That would then redirect to my local IP
Something like this
127.0.0.1 *:7777
Is this a pipe dream or doable in someway?
You can use Firefox Extension Server Switcher
This firefox extension is a tool for web developers and allows switching between sites on your development and live servers; it helps you to see difference immediately.
It's more easy in use than host file.

JMeter Proxy not recording local sites in IE 8

I am learning JMeterProxy using WAMP and opencart web app.I did a recording using HTTP Proxy Server. I configured firefox and recording went smoothly. But if i am using IE, nothing seems to be recorded. I added a tree view listener in HTTP Proxy to log the recording, nothing is logged in it when i am using IE.
Some observations:
when i stop recording and if i try to access the local site using FF, it is not accessible, but in case of IE i could open the site.
If i browse an external site, recording is working.
I am accessing my site as http://localhost:81/opencart/index.php, since 80 port is used by IIS
My question is.
How would i trouble shoot this kind of scenario.
What changes i should i make in IE proxy settings.
I solved this problem, Here is the solution, as per JMeter documentation
If JMeter does not record browser URLs such as http://localhost/ or
"http://127.0.0.1/", try using the non-loopback hostname or IP address,
e.g. http://myhost/ or "http://192.168.0.2/"
So providing the host name in place of loop back address solved the problem

Resources