A "port" to the US
December 8, 2008 7:44 PM   Subscribe

How can I spoof the locale configuration of Firefox 3.0 to make it think that I'm in the US instead of Japan?

I'm currently connected to the Internet via a LAN cable in my hotel in Japan. Not-so-conveniently, Firefox has configured itself in the background, apparently, for Japan.

For example, when I type "www.google.com" to Google English sites, the URL line automatically changes to "www.google.co.jp," and delivers results for Japanese sites. Also, I get "you don't live in the US" when I try to access hulu.com. Note that I got through to my intended sites before I boarded the plane, flew to Japan, and connected to the LAN port in my Japanese hotel.

What's going on here, exactly? Is there a sequence of lines I can copy into the "about:config" file that will make Firefox think I'm in the US? Failing that, are there simple-to-install proxy programs that will spoof the bad locale settings and make Firefox think I'm back in the States? (I'm on a MacBook, BTW).
posted by Gordion Knott to Computers & Internet (13 answers total) 20 users marked this as a favorite
 
It's not your browser. Google is helpfully (and hulu less helpfully) serving you their Japanese site because you are coming from a Japanese IP address.
posted by steveminutillo at 7:56 PM on December 8, 2008 [1 favorite]


This isn't actually a Firefox thing, you're running into 2 issues, both sites are geolocating your IP to determine what happens to you.

Google you can set to stay on google.com in its preferences, for hulu you'll need a proxy service like Tor to fake the fact that you're in the US
posted by bitdamaged at 7:56 PM on December 8, 2008


I'd recommend HotSpot Shield. It's meant for secure browsing at open Wifi points, but works perfectly for Hulu, etc.
posted by blue_beetle at 8:17 PM on December 8, 2008 [2 favorites]


As others have said, you need a US-based proxy server to convince the websites you're dealing with that the endpoint of your connection is in the US.

Tor is the wrong tool for this job, because it does a lot of unnecessary packet routing to cover your tracks, which is its main design purpose. You also have no guarantee that the point at which your traffic emerges from Tor into the wider Internet is actually going to be inside the US.

Personally, I use an SSL tunnel to Amazon EC2 instance running Ubuntu 7.10 Server for this job. It's a bit techy to set up (possibly slightly less so with the ElasticFox extension for Firefox, which I have not played with yet), but once done, I get a high speed US-terminated tunnel that costs me 10 cents per hour, 10 cents per gigabyte uploaded, and 17 cents per gigabyte downloaded. As well as making the rest of the Internet see my location as the US, this setup also secures me against black-hats in my hotel or wifi hotspot.

This Ubuntu 7.10 Gutsy Base Install Amazon machine image is all that's required on the EC2 end - no extra software needs installing, because the same OpenSSH server that's already built into the AMI to let you control it includes a SOCKS 5 proxy that Firefox can talk through.

In Linux I use ssh -D localhost:1080 my.amazon.ec2.public.dns.address to set up the SSH connection and the tunnel. On Windows, I use PuTTY to establish the SSH connection to my EC2 instance, with a "dynamic" port created on localhost port 1080; this does the same job. Then I tell Firefox to use localhost port 1080 as a SOCKS version 5 proxy, and set the network.proxy.socks_remote_dns option in about:config to true as well for good measure (this means that all my DNS requests go via the tunnel as well, avoiding local DNS snooping and poisoning).
posted by flabdablet at 8:43 PM on December 8, 2008 [20 favorites]


Having just now played with ElasticFox, I can report that it does indeed make the whole process much less intimidating. If you're interested in going this route and can't work it out yourself, post back and I'll write up a step-by-step.
posted by flabdablet at 10:15 PM on December 8, 2008 [1 favorite]


flabdablet: I'd love a step-by-step for Windows but moreso for OS X if possible?
posted by gen at 1:18 AM on December 9, 2008


flabdablet: that's awesome. 22ยข worth of awesome, so far.
posted by oaf at 9:57 AM on December 9, 2008


OK, here's how it's done. Let me know if it works for you.

1. Install Firefox.

2. Install the Elasticfox and MultiProxy Switch extensions into Firefox, and restart it to activate them.

3. Use the Firefox View->Toolbars menu to turn off the MultiProxy Switch extension's toolbar, which just adds clutter.

4. Click the Proxy: None item in the Firefox status bar, and choose Manage Proxies from the resulting pop-up menu. In the resulting Manage Proxies window, click Add. In the resulting Proxy Info window, fill in the following fields:

Proxy Label: SOCKS
* Manual Proxy Configuration
SOCKS Proxy localhost Port 1080
* SOCKS v5

Leave the other fields as they are, click OK to dismiss the Proxy Info window, and click OK to dismiss the Manage Proxies window.

5. Type about:config into the Firefox address bar. In the resulting about:config window, type dns into the Filter: box, then double-click network.proxy.socks_remote_dns to change its value from false to true.

6. Choose Elasticfox from the Firefox Tools menu. In the resulting Elasticfox tab, click the Tools button (near top right). In the resulting Manage EC2 Tools window, change the SSH Arguments: field from

-i "${key}" ${user}@${host}

to

-i "${key}" -D localhost:1080 ${user}@${host}

and click OK to dismiss the window. That D has to be uppercase, by the way.

7. Download, save and open the Elasticfox Owner's Manual, read the Introduction, then work through the steps from "Setting up an AWS Account" to "Creating a KeyPair".

8. If you're not using Windows, skip to step 9; the following PuTTY-specific section shouldn't be necessary with the ssh clients that come standard with OS X and other Unix-like systems.

8a. Install PuTTY.

8b. Start PuTTYgen (Start->All Programs->PuTTY->PuTTYgen). In the resulting PuTTY Key Generator window, click Load.

8c. In the Load private key: window, change the Files of type: field from PuTTY Private Key Files (*.ppk) to All Files (*.*), then navigate to the folder where you saved the .pem file you made in "Creating a KeyPair".

8d. Click the name of your .pem file, then click Open. When you see the PuTTYgen Notice confirming successful key importation, dismiss it by clicking OK.

8e. Back in the PuTTY Key Generator window, click "Save private key". Dismiss the warning about saving the key without a passphrase by clicking Yes.

8f. In the Save private key as: window, type the same name into the File name: field as you used for your .pem file but change the extension from .pem to .ppk (for example, my files are called ec2-flabdablet.pem and ec2-flabdablet.ppk) and click Save.

8g. Close the PuTTY Key Generator window.

You've now completed all the once-only setup steps. Whenever you want to use your EC2-terminated tunnel, skip straight to this point.

9. Work through the Owner's Manual steps from "Tutorial #1: Running an Instance" to the end of "Step 4: Connecting to the Instance". Any Linux-based AMI, including the "getting-started" one specified in the tutorial, will work just fine - you don't need to choose an Ubuntu-based one.

10. Click the Proxy: None item in the Firefox status bar, and choose SOCKS from the resulting pop-up menu.

If all's gone well, your web browsing is now happening via the tunnel to your EC2 instance. You can test this by visiting whatismyipaddress.com.

To stop using the tunnel and turn off Amazon's taxi meter, do this:

11. Click the Proxy: SOCKS item in the Firefox status bar, and choose None from the resulting pop-up menu.

12. Work through the Owner's Manual "Cleaning Up: Terminating your Instance" step.

You can do lots of cool stuff with EC2. Start by reading the rest of the Owner's Manual and get inspired.
posted by flabdablet at 1:55 AM on December 10, 2008 [12 favorites]


Hmm. That Sourceforge link isn't as much use as the Elasticfox home page.
posted by flabdablet at 9:13 PM on December 10, 2008


You could visit http://google.com/ncr instead and force Google to show you its 'main' front page in English.
posted by genghis at 4:02 PM on December 11, 2008


Excellent instructions, flabdablet, thanks!

There's an additional problem, though. Apparently, Hulu's system now also does a geo-locate on the actual Flash stream (RTMP stream). Since Flash, somewhat disappointingly, doesn't honor the proxy settings of your browser, Hulu can now detect your (non US-ian) ip again...

To circumvent this, you can use a utility called proxifier for windows. A full description of how to set this up can be found here. Worked for me.
posted by The Toad at 1:37 PM on January 3, 2009


Thanks, flabdablet. I haven't tried Hulu (and based on The Toad's message, I'm guessing that it won't work, at least not without proxifier), but it works great for some other sites that I've been geo-blocked from. Also, it looks like there's a Mac version of proxifier, so I may look into adding that.
posted by klausness at 3:42 PM on January 6, 2009


Many an old U.S. employer might has left you an active account with VPN access? If you've an active university account, they'll provide good VPN service. Faculty, postdoc, and grad student accounts are usually never deactivated. But most universities deactivate undergraduate accounts after 6--12 months.
posted by jeffburdges at 2:20 AM on September 15, 2009


« Older How do I database?   |   piz or how do we flip it and keep the zip? Newer »
This thread is closed to new comments.