Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error when connecting to a web server on port 6666 (http://myserver:6666/):

Error 312 (net::ERR_UNSAFE_PORT): Unknown error.

Is there an easy way to resolve this without rebuilding Chrome from source?

share|improve this question
up vote 43 down vote accepted

Right Click on Chrome shortcut >> Properties >>

Then Append --explicitly-allowed-ports=xxx to shortcut target

Example:

C:\Documents and Settings\User\Local Settings\Application Data\Google\Chrome\Application\chrome.exe --explicitly-allowed-ports=6666

Resource from here

share|improve this answer
1  
I missed this answer, thanks. I opened a separate question to understand which ports are safe/blocked by default: superuser.com/questions/188058/… – ripper234 Sep 13 '10 at 12:36
1  
This answer is excellent... for Windows. It won't solve the problem for (for example) Mac. – Chris R May 3 '12 at 17:23
    
@ChrisR: Why? Does the --explicitly-allowed-ports switch not exist for Mac? – Dennis May 3 '12 at 17:35
1  
Adding command line flags on the mac is a pain in the ass; if you add them to the app bundle they often get nuked in upgrades. – Chris R May 3 '12 at 17:39
    
@ChrisR: You should consider adding this to your question. – Dennis May 3 '12 at 17:44

You may be able to turn this off in Google Chrome, but you do so at your own risk. There is actually a good security reason why Chrome blocks these ports: Basically you open your browser up to being an open proxy for attackers to use to attack other services on your network.

For more information: Why does Chrome consider some ports unsafe?

share|improve this answer
    
@JanHudec You are correct. – Case Jul 29 '14 at 20:36
    
+1 for the analysis in your blog post :) – cxw Aug 21 '15 at 16:52

As subanki said, you've got to add the -explicitly-allowed-ports option to your Chrome startup command.

In Ubuntu you can do this (as root) by editing the "google-chrome" script under your Chrome installation folder

You can get the directory by typing:

ls -la /usr/bin | grep chrome

Then, edit the "google-chrome" file adding the mentioned switch to the EXEC line:

exec -a "$0" "$HERE/chrome" "-explicitly-allowed-ports=6000" "$@"

Just change "6000" with the comma separated values you might need (example: -explicitly-allowed-ports=5000,6000,7000)

NOTE: for UNIX, the switch does NOT start with "--", it does with a single "-"

share|improve this answer

For Mac:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --explicitly-allowed-ports=5000,6000,7000

for ports 5000, 6000, and 7000.

share|improve this answer

Mac options with Automator (much better than manual launch) http://cubewot.de/node/266

On the Mac you can either start chrome with the terminal with " open /Applications/Google\ Chrome.app --args --explicitly-allowed-ports=PORTNUMBER" or create you own app with Automator

image

share|improve this answer
    
Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Apr 14 at 13:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.