Chrome remote debugging doesn't work with IP - google-chrome

I'm trying to remote debugg a chrome instance using the remote debug option in chrome:
chrome.exe --remote-debugging-port=1337
as described on google page: http://code.google.com/chrome/devtools/docs/remote-debugging.html
the problem is when i try to access it using IP it doesn't work, while testing it with localhost:1337 does work.
any idea?

You can setup an SSH tunnel in order to debug remotely. On the source machine execute:
ssh -L 0.0.0.0:9223:localhost:9222 localhost -N
Then on the other machine point Chrome browser to http://source-machine-ip:9223

I don't think Chrome accepts connections from outside of localhost (for security reasons).
I would suggest you have to build small proxy on the same host where Chrome is.

The following worked for me when running a Chrome remote debugging host on Windows 8.
Add an Inbound Rule to Windows Firewall
Search for "Windows Firewall" and select the "Windows Firewall" result
On the left of the "Windows Firewall" control panel window, click "Advanced Settings". This will open up "Windows Firewall with Advanced Security".
In the tree view on the left, click "Inbound Rules"
On the far right, click "New Rule..."
Select "Port" (Click Next)
Select TCP and set "Specific local ports" to 9222 (Click Next)
Select "Allow the connection" (Click Next)
Choose the profile access (Domain, Private, Public) to suit your needs (Click Next)
Give it a name like Chrome Remote Debugging (9222) (Click Finish)
Follow user3445047's instructions on port forwarding:
Run Chrome on the Windows host:
chrome.exe --remote-debugging-port=9222
Set up port forwarding on the Windows host:
Open up a cmd window. You must "Run as administrator".
Enter the following into the cmd window:
netsh
interface
portproxy
add v4tov4 listenport=9222 connectaddress=127.0.0.1
On the client, navigate to http://THE_HOST_IP_ADDRESS:9222 and you should be presented with a list of "Inspectable Pages".

The easiest way of sharing your debugging session with another computer is with socat.
For example, if you've enabled the remote debugging protocol on port 1337 using
chromium --remote-debugging-port=1337
Then, you can create a tunnel using socat,
socat tcp-listen:5656,fork tcp:localhost:1337
After doing this, anyone can just visit http://<YOUR_IP_OR_HOSTNAME>:5656/ and immediately use the debugger.
When you're done, press Ctrl + C to terminate socat and thus stop the tunneling.
If the previous code does not work, check whether the firewall (e.g. iptables) is blocking access. If the firewall is OK, check whether the IP address or host name is actually correct. To see whether the traffic is correctly forwarded/tunnelled, visit http://localhost:5656/ and verify that there's a Webkit debugger instance running.

Start the headless server
chrome.exe --remote-debugging-port=9222
Set up Port forwarding on windows
netsh interface portproxy add v4tov4^
listenport=9222 listenaddress=0.0.0.0^
connectaddress=127.0.0.1 connectport=9222

recent Chrome versions support the commandline switch "--remote-debugging-address" so the workarounds listed above should no longer be necessary.
Here the description:
"Use the given address instead of the default loopback for accepting remote debugging connections. Should be used together with --remote-debugging-port. Note that the re-mote debugging protocol does not perform any authentica-tion, so exposing it too widely can be a security risk."

You can create simple TCP proxy with netcat:
EXTERNAL_PORT=1338
CHROME_DEBUG_PORT=1337 # This is the port specified with --remote-debugging-port
nc -l -p ${EXTERNAL_PORT} -c "nc 127.0.0.1 ${CHROME_DEBUG_PORT}"

Try changing port number
That works for me.

Related

Can't access the network / Internet from WSL 2 when ufw is enabled

I updated my Win 10 Pro box to WSL 2 and changed the /etc/resolv.conf file et. al to allow WSL to access the Internet (and that works fine), but if I enable ufw (with just http / https allowed through), all networking is blocked. "ping 8.8.8.8" just hangs and "sudo apt update" returns "Temporary failure resolving 'archive.ubuntu.com'"
Are there other services/ports I'm supposed to open in ufw to make this work? Are there changes I'm supposed to make to the Hyper-V Manager?
(FYI: I put "nameserver 208.67.222.222" (OpenDNS) in the resolv.conf file (yes, I followed others' advice to prevent resolv.conf from being overwritten).)
I also created a rule in Windows Defender to allow bash.exe access, but since WSL 2 doesn't use the Windows firewall, that was probably a waste of time. I can't find any information anywhere on how to properly configure ufw for WSL 2, so any information would be appreciated...
Make sure that NTFS compression is not applied at two WSL-dependent directories (%LocalAppData%\Packages\CanonicalGroupLimited* and %TEMP%, more detailed my answer at https://stackoverflow.com/a/68854905/12691808)

Can't access internet with Chrome, Firefox after Win 10 upgrade, Edge works fine though

After installing google chrome(version 75.0.3770.100) in windows 10(update 7/7/2019), I lost Internet connection.
The error is:
The DNS server isn't responding.
I tried to solve it but it was not successfull. for example in CMD:
netsh winsock reset
ipconfig /flushdns
ipconfig /renew
But when I remove google chrome from Windows 10, Internet connects again!!!
I do not no why! It's very strange!
How can I solve this problem, while keeping chrome?
Have you tried changing both ipv4 and ipv6 dns to:
The Google Public DNS IP addresses (IPv4) are as follows:
8.8.8.8
8.8.4.4
The Google Public DNS IPv6 addresses are as follows:
2001:4860:4860::8888
2001:4860:4860::8844
If changing that DNS solves the problem, you have to call you internet company and tell the problem, or change internet company. (if you don't want to use google dns)
Try the following possible solutions:
Change The DNS Server
If there is a problem with your IP DNS server, you can try to change your DNS server to Google's Public DNS, a free alternative Domain Name System (DNS) service offered to Internet users around the world. The public DNS service and servers are maintained and owned by Google. It functions as a recursive name server providing domain name resolution for any host on the Internet. You will have to change the DNS manually, and we show you how.
To change your DNS server to Google's DNS server, go to your Network Connections settings. Right-click the Start menu and select "Network Connections", or go to Settings and click" Network & Internet".change dns server
Change dns server step 1
In the Network & Internet settings window, select your connection type (in our case, "Ethernet") on the left pane and then click "Change adapter options" on the right pane.
Change dns server step 2
Right-click on your connection and select "Properties" from the drop-down menu.
Change dns server step 3
Select "Internet Protocol Version 4 (TCP/IPv4)" and click "Properties".
Change dns server step 4
In the Internet Protocol Version 4 (TCP/IPv4) Properties window, select "Use the following DNS server addresses", enter 8.8.8.8 as the "Preferred DNS server" and 8.8.4.4 as the "Alternate DNS server". Click "OK" to save changes and check if this helps to fix the problem with the "DNS server is not responding" error.
Change dns server step 5
Disable IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv6 was developed to deal with the long-anticipated problem of IPv4 address exhaustion. Disabling the IPv6 feature might help to fix the "DNS server is not responding" error.
The easiest way to disable IPv6 on the Windows operating system is via the Network and Sharing Center. To open it, go to Control Panel and click "View network status and tasks" under "Network and Internet".
Disable ipv6 step 1
Click your connection (in our case, "Ethernet").
Disable ipv6 step 2
In your connection status window, click "Properties".
Disable ipv6 step 3
In your connections properties window, find "Internet Protocol Version 6 (IPv6)" and unmark the checkbox to disable it. Click "OK" to save changes and see if this helps to fix the "DNS server is not responding" error.
Disable ipv6 step 4
Reset Your Router
Simply restarting your router or modem may help to fix this problem. We suggest you try this possibility first. If there is an "On/Off" button on your router, simply press it to turn off your router, wait a while, and then turn it on again. If there is no button on your router, disconnect it from power supply. When your router has restarted, try restarting your computer as well and see if this helps.
There might be a problem with your router configuration - this can also cause this "DNS server is not responding" error. To fix it, reset the router to its default settings. Open your router's configuration web page and find the "Reset" option. If you cannot access the router's web-based setup page and you want to reset the router to its default factory settings, press and hold the Reset button for 10 seconds. Bear in mind that resetting your router to its default factory settings will also reset your router's password.
Enter MAC Address Manually
A Media Access Control address (MAC address) of a device is a unique identifier assigned to network interfaces for communications at the data link layer of a network segment. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet and Wi-Fi. MAC addresses are used in the media access control protocol sublayer of the OSI reference model. These MAC addresses are often assigned by the manufacturer of a network interface controller and stored in its hardware such as the card's read-only memory or other firmware mechanism. To fix the "DNS server is not responding" error, you will need to enter the MAC address manually, but first you need to find it using an elevated Command Prompt and one of the commands.
Command Prompt is the input field in a text-based user interface screen, a command line interpreter application available in most Windows operating systems. It is used to execute entered commands, most of which are used to automate tasks through scripts and batch files, perform advanced administrative functions, troubleshoot and solve certain types of Windows issues. In the early days of computing, Command prompt used to be the only way to interact with the computer, so a basic set of commands with rigid syntax was developed to perform all system functions. Command Prompt's official name is Windows Command Processor but it is also sometimes called ​the command shell or cmd prompt, or even referred to by its filename cmd.exe.
To use Command Prompt, you must enter a valid command along with any optional parameters. It then executes the command as entered and performs its specific Windows task or function. Some commands available in Windows require that you run them from an elevated Command Prompt i.e. with administrator level privileges. The command we need to use requires an elevated Command Prompt to be opened with administrator privileges. To open elevated Command Prompt type "command prompt" in Search and right-click the "Command Prompt" result. Choose "Run as administrator" to run it with administrative privileges.
Enter Mac address manually step 1
When you select "Run as administrator", a User Account Control prompt will appear asking if you allow the Command Prompt to make changes to your computer. Click "Yes".
Enter Mac address manually step 2
Elevated Command Prompt will appear. In opened the Command Prompt window, type the "ipconfig /all" command and press Enter on your keyboard. You will see a list of information about the configuration. Find "Physical Address" and take a note of it somewhere - you will need it to proceed to the next step.
Enter Mac address manually step 3
Now that you have your MAC address, you can configure your network connection manually. To do so, Right-click on the Start menu and select "Network Connections", or go to Settings and click "Network & Internet".
Enter Mac address manually step 4
In the Network & Internet settings window, select your connection type (in our case, "Ethernet") on the left pane and then click on "Change adapter options" on the right pane.
Enter Mac address manually step 5
Right-click on your connection and select "Properties" from the drop-down menu.
Enter Mac address manually step 6
In the Properties window, select "Client for Microsoft Networks" (it should be selected automatically) and click "Configure".
Enter Mac address manually step 7
Now select the "Advanced" tab and then select "Network Address" under "Property:" Select "Value:" on the right pane and enter your MAC address (Physical Address), which you received when you entered the "ipconfig/ all" command in Command Prompt.
Enter Mac address manually step 8
Click "OK" to save the changes and see if this helps to fix the "DNS server is not responding" error. There is a higher chance that it will be fixed if you were using Google DNS before entering the MAC address manually.
Reset Your IP And Clear DNS Cache
This method includes entering and executing "netsh" and "ipcofig" commands into Command Prompt.
Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer.
Ipconfig is a command-line tool that displays the current configuration of the installed IP stack on a networked computer. Using tool, we can flush and reset the contents of the DNS client resolver cache and renew DHCP configuration.
The commands require an elevated Command Prompt opened with administrator privileges. To open elevated Command Prompt, type "command prompt" in Search and right-click on the "Command Prompt" result. Choose "Run as administrator" to run it with administrative privileges.
Reset ip and clear dns cache step 1
When you select "Run as administrator", a User Account Control prompt will appear asking if you allow the Command Prompt to make changes to your computer. Click "Yes".
Reset ip and clear dns cache step 2
Elevated Command Prompt will appear. In the Command Prompt window, type these commands:
netsh int ip reset
netsh winsock reset
ipconfig /flushdns
ipconfig /renew
Press Enter on your keyboard after entering each command. When all commands are executed, restart your computer and see if this helps to fix the "DNS server is not responding" error.
Start Your Computer In Safe Mode
Safe Mode is a diagnostic start-up mode in Windows operating systems used to obtain limited access to Windows when the operating system does not start or function normally. It is the opposite of Normal Mode, which starts Windows in the usual manner. Safe Mode is available on Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10, and most older versions of Windows.
One of the most common steps when troubleshooting a computer is to boot into Safe Mode. Safe Mode starts Windows in a basic state, using a limited set of files and drivers. It can help to troubleshoot problems on your computer. Read this article about how to boot your Windows 10 into Safe Mode.
Check if you are still having network connection problems when Windows starts in Safe Mode. If there are no problems with the network connection, you probably have third-party software installed in Windows that is causing the problem. Third-party applications can affect the DNS - almost any network-related or security application can interfere with your DNS, so find the problematic software and uninstall (or re-install) it.
Update Your Drivers
By update we mean that you should install the latest network adapter drivers on your computer. This problem might be caused by an old or incorrect driver. In this case, you need to get an updated/new driver for your network adapter. There is an easy way to do this automatically with Snappy Driver Installer. You will need a computer with a working internet connection in order to download it.
Snappy Driver Installer (SDI) is a powerful free driver updater tool for Windows that can store its entire collection of drivers offline. Having offline drivers gives Snappy Driver Installer the ability to have access to fast driver updates, even if there is no active internet connection. Snappy Driver works with both 32-bit and 64-bit versions of Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Drivers are downloaded through Snappy Driver Installer in what are called driverpacks, which are just collections (packs) of drivers for various hardware like sound devices, video cards, network adapters etc. It can also show duplicate drivers and invalid drivers and it separates the updates that require you to restart your computer so it would be easier to distinguish them from the rest. You can download Snappy Driver Installer from here.
Update drivers step 1
After you have finished updating and installing drivers, restart Windows 10 for them to take effect and try to connect to the internet to see if it works.
You can also update your drivers manually, but you will need a computer with a working Internet connection. Go to the network adapter manufacturer's website and download the latest driver, copy it onto your USB drive. Go to Device Manager (type "device manager" in Search and open it). Expand the "Network adapters" section, select your network adapter, right-click on it, and then choose "Update Driver".
Update drivers step 2
You will be asked how do you want to search for drivers and given two options: 1) to search automatically for updated driver software, and; 2) to browse your computer for driver software. The first option requires an Internet connection. Since you have problems with your Internet connection, choose the second option. Locate the driver on your USB drive and follow the instructions.
Update drivers step 3
When you have finished installing the new/updated driver, restart your computer for the changes to take effect and see if the network connectivity problem is fixed.
Disable Your Antivirus
The "DNS server is not responding" error can occur due to installed antivirus software. Temporarily disabling it might help to fix the problem. If disabling the antivirus software fixes the problem, you might want to consider switching to a different antivirus program. This error usually occurs when you have installed third-party antivirus software, but you should not be concerned about your safety, since the built-in Windows Defender software should be adequate.
Disable Secondary Connections
If you have more than one network connection available on your computer, try disabling the other connections and leave only the current connection enabled. Go to Network Connection settings. Right-click the Start menu and select "Network Connections", or go to Settings and click "Network & Internet".
Disable secondary connections step 1
In the Network & Internet settings window, select your connection type (in our case, "Ethernet") on the left pane and then click "Change adapter options" on the right pane.
Disable secondary connections step 2
Right-click on the other connection and select "Disable" from the drop-down menu. Apply this to all secondary
Disable secondary connections step 3
Disable Windows Update Peer-to-peer Feature
Windows 10 has a new feature that helps to save download bandwidth. It is a new peer-to-peer (P2P) delivery update mechanism. Using the P2P option, you can download a Windows update once, and then use that machine to spread the update to all computers on your local network, you can also download Windows updates from other users in your area. This feature can interfere with the DNS, and disabling it might fix the "DNS server is not responding" error. To disable this feature, go to Settings and select "Update & Security".
Disable windows update peer to peer feature step 1
Locate "Advanced options" under "Update settings" and click it.
Disable windows update peer to peer feature step 2
In the Advanced options window, click "Delivery Optimization".
Disable windows update peer to peer feature step 3
In the Delivery Optimization window, turn off the "Allow downloads from other PCs" option by toggling the switch. Check if the "DNS server is not responding" error persists.
Disable windows update peer to peer feature step 4
We hope that the methods described above helped you to fix the "DNS server is not responding" error and you are now able to connect to the Internet without any network connection problems. If none of the above solutions worked, the error might be caused by your Internet service provider. Wait until your Internet service provider fixes the technical issues and try connecting to the internet after few hours.
Hope this helps pal. Greetings!

Using getUserMedia() on insecure origins in Chrome

I am developing a webpage that uses camera. When I test in Chrome in my local network, camera doesn't work and I get warning in the console:
getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See link for more details.
In the link provided there is an instruction to set some flags in Chrome. So I tried. My command looks like this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --unsafely-treat-insecure-origin-as-secure="192.168.0.15" --user-data-dir=c:\chrome-dev-profile
But when I run Chrome I get this message:
You are using an unsupported command-line flag: --unsafely-treat-insecure-origin-as-secure. Stability and security will suffer.
What am I doing wrong?
Is there another way I can test in local network without setting up https server? I need this just for development.
Luka,
I've run into this bug just yesterday. I have not found out how to get Chrome to honor that flag on the command line yet. But I did find a workaround that works for my case.
I'm running my web services on a Linux machine that is running an ssh server. I'm testing on windows with chrome, and used putty to connect to the linux box from windows and then created a "local port forward" to make my remote linux box's ipaddress:port appear on localhost:port on windows. Depending on your platform this workaround may work for you. This approach isn't too cumbersome if you only have a few ports to forward.
In my particular case my setting for putty looked like
L8080 localhost:8080
To see more about port forwarding and ssh see: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding

Chrome localhost does not work

I have defined some virtual servers that until the last days were working fine.
Now they don't on Chrome, but there are no problems in firefox or safary.
I get this:
This webpage is not available
ERR_ICANN_NAME_COLLISION
Hide details
This site is using a new generic top-level domain (gTLD). If you have
used loc.dev to access an internal site in the past, contact your
network administrator.
I found as a solution:
Set the "Built-in Asynchronous DNS" to "Disabled" in chrome://flags, but the is no such flag in my chrome version ( 43.0.2357.81 )
Do you know a solution for this?
LE : If i move the site on the htdocs file and i go on the url http://localhost, it works. It seems that it has a problem only with virtualhosts.
Got the same issue after updating to the latest chrome version last night. I was getting a ERR_NAME_NOT_RESOLVED error only on google chrome for all of my virtual hosts. Here's how that looked.
Screen Shot-> DNS name not resolved error
Here's the fix I made.
Clear up the google DNS cache by typing this in the Chrome browser
chrome://net-internals/#dns
Screenshot -> Flushing Chrome DNS cache
You will see a button "Clear Host Cache". Press that DNS cache
will be flushed.
Keep this DNS window open. Now access the virtual host in the browser
for me it was http:/api.localhost. Once you do that you will see a
new entry in the DNS window. for me it was "localhost."
notice the period "." at the end of localhost that showed an error.
Last step is to simply add this entry as to your localhost file.
Your hosts file should be updated with an entry to resolve localhost. to 127.0.0.1:
# dont forget the trailing . !!!
127.0.0.1 localhost.
in the hosts file located at:
for linux : /etc/hosts
for windows : C:\Windows\System32\drivers\etc\hosts
Another solution for your case might be to ditch the .dev at the end of your local virtual host domain
This has to do with some new changes by google. ".dev" comes under google's TLD (In the corner of the internet where people care about DNS, there is a bit of an uproar at Google's application for over a hundred new top-level domains, including .dev)
Try this Use a domain name you own. Possibly using the full name like "localhost.dev.$yourdomain" could help you here depending on your setup.
With the 'chrome' I face the same issue because by mistake I comment out the
127.0.0.1 localhost from the host file, But 'Firefox' will work.
Just make sure your host file include
127.0.0.1 localhost
FIXING
Try contacting your system administrator.
ERR_ICANN_NAME_COLLISION.
if you are using magento and getting such error
just go to you database and search for core_config_data
click on it then check your web store name
change the store name
restart your wamp and fixed.
Worked for me:
chrome://net-internals/#hsts -> Domain Security Policy -> Delete domain security policies -> enter there localhost and press delete
Here is another catch for you, my virtual hosts in Windows hosts file were defined as:
127.0.0.1 bla.bla.bla.localhost
127.0.0.1 bla2.bla2.localhost
And actual server virtual host directives in Xamp Apache Vhosts file made it all work nicely in all browsers, but Chrome!
A simple fix - dont end with full "locahost" word, rename the vhosts to end with anything else, just "loc" did it in my case, all works in Chrome now!
Been having this problem with Version 56.0.2924.87 (64-bit) of chrome, attempting to access a vm by gset.localhost, just would not work.
Changed the url in the hosts file to gset.loc and it works fine.
The answer seems to be do not use localhost in your hosts file urls when attempting to access a virtual machine running on your machine using chrome.
All browsers - chrome, firefox, safari were not resolving my virtual host and kept re-directing to www.mysite.dev
After pulling my hair for hours - it turned out I just need to change mysite.dev to www.mysite.dev in the /etc/hosts file.

VisualSVN messed up my localhost in Chrome

EDIT:
The localhost seem to be working fine in my firefox, IE and even Chrome's incognito mode. These is a problem specific to chrome. Any ideas?
PREVIOUS:
I just uninstalled VisualSVN Server from my Windows 7. But now when I try to hit localhost, I get redirected to localhost/svn. I am using WAMP and developing something that requires the root access. I can not put the project in a sub directory. I have also tried netstat -ao but no process is using ports 80 or 443.
You may have solved the problem....but for future, those who came here like me looking for a solution to this, this seems to be a prob for browser cache....clearing browser cache history solves the problem.....did for me...
If you uninstalled VisualSVN Server, then it's some other application which runs on 80 / 443 port that redirects you to /svn. Some steps that may help you to determine the root cause:
Verify that VisualSVN Server has been successfully uninstalled.
Start appwiz.cpl and see whether VisualSVN Server is listed as the installed application,
Start services.msc and see whether "VisualSVN Server" service is listed.
Run netstat -anbv and see which app runs on HTTP(S) port.