108
votes
Accepted
How to kill a localhost:8080
You can track down the process running on port 8080 and kill it.
For macOS or Linux:
sudo lsof -iTCP:8080 -sTCP:LISTEN
You should get an output something like:
COMMAND PID USER FD TYPE ...
70
votes
Accepted
Why does the registered domain name “localtest.me” resolve to 127.0.0.1?
However, I'm still not sure how you can register an external domain to a local one. This is confusing as a tracert localtest.me never even leaves the machine. How is this handled on the low level?
...
23
votes
Windows 10 WSL cURL can't access localhost with error (Failed to connect to localhost port 80: Connection refused)
Updated 2023-12-27
This should be addressed now with the mirrored networking mode and recent patches. Definitely follow the instructions from 2023-10-31 and avoid rolling back to WSL1 if possible ...
18
votes
How can I specify IP and ports for a hostname in the Windows hosts file?
The hosts file is for resolving hostnames to IP addresses only
If you do not specify a port as part of a URL, e.g. <protocol>://<hostname>[:<port>][/path], your browser will use the ...
17
votes
How to connect wsl to a windows localhost?
You should run the following command in a powershell run as administrator:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action ...
16
votes
Why does the registered domain name “localtest.me” resolve to 127.0.0.1?
There are other answers that go into deeper detail, but the core of this question is really simple to answer:
“However, I'm still not sure how you can register an external domain to a local one.”
...
12
votes
Can't access localhost from computer running on same network
I know this is an older question, but @PimpJuiceIT answer worked for me in a very similar situation, so full credit there.
Open an elevated command prompt (press windows, type "cmd", right ...
10
votes
How to map an IP adress to localhost?
Run under admin command prompt:
C:\Windows\system32>netsh int ip add address "Loopback" 192.168.1.222
C:\Windows\system32>netsh int ip show addresses
接口 "Loopback Pseudo-Interface 1" 的配置
...
10
votes
Accepted
Is there a default port that is requested by web browsers?
If I request http://localhost do browsers try a specific port?
There are three well known ports commonly used by web servers:
Port 80: for HTTP.
Port 8080 is often used as an alternative to port 80, ...
10
votes
Ubuntu IPv6 ping self gives unknown host
Works with /64 removed and -I specified. The /64 refers to the number of bits in the mask and shouldn't be used in ping.
$ ping6 -c 1 -I enp0s25 fe80::ba94:3d5e:9929:4c6e
PING fe80::ba94:3d5e:9929:...
10
votes
Accepted
How to connect wsl to a windows localhost?
I am not sure if the following will work with applications that are bound to just localhost, but this worked for Fiddler and WSL2:
Set the Fiddler option "Allow remote computers to connect" and ...
10
votes
Accepted
localhost and 127.0.0.1 working but not ip address in wsl windows 10
The core issue here is that WSL2 operates in a Hyper-V VM with its own virtual NIC, running NAT'd behind the Windows host. WSL1, on the other hand, ran bridged with the Windows NIC.
On localhost, ...
9
votes
Can't access localhost from computer running on same network
Open a Command Prompt window and execute the following command to confirm whether or not your web application is listening on all IP addresses:
netstat -a -o
You'll see output similar to the ...
9
votes
Windows 10 WSL cURL can't access localhost with error (Failed to connect to localhost port 80: Connection refused)
A quick workaround is to set an alias to the cmd version of curl and use that from wsl2.
In you ~/.bashrc, set following:
alias curl="cmd.exe /C curl"
After you restart or source .bashrc, ...
8
votes
Change xampp apache htdocs directory to access localhost from ubuntu and windows
This is an old question but I haven't seen it properly answered yet. Here is what you need to do:
Install XAMPP in Windows and LAMPP in Ubuntu
Boot into Ubuntu and record your Windows htdocs folder (...
8
votes
How can I redirect "localhost" to another local IP?
If you’re on Windows, you can use the command:
netsh interface portproxy add v4tov4 listenaddress=192.168.1.101 listenport=21 connectaddress=192.168.1.102 connectport=21
Replace:
21 with the port ...
8
votes
Why does the registered domain name “localtest.me” resolve to 127.0.0.1?
What is so special about localtest.me?
It points to 127.0.0.1 (localhost). This address is always reserved for the local computer.
Are there others? (And how to find them?)
Yes. Google and Super ...
8
votes
Ubuntu IPv6 ping self gives unknown host
You should not use the /64 on the address in the ping. That would be the equivalent of using a mask length or mask on the ping command for IPv4. I suppose the ping command was trying to interpret that ...
8
votes
How to connect wsl to a windows localhost?
WSL 2 requires some extra work as compared to WSL 1.
Allow the required port(s) through the firewall.
1.1 Launch Windows Defender Firewall with Advanced Security
1.2 On the left pane select Incoming ...
7
votes
How to prevent Firefox converting 'localhost/*' URLs into search queries?
If you still want to be able to search from the address bar, but you also want to be able to open local URLs, you can set the about:config property browser.fixup.dns_first_for_single_words to true, ...
7
votes
How to kill a localhost:8080
If you install ProcessExplorer from SystemInternals, then you can see the process tree.
In ProcessExplorer, click the target-sight button, and then click on the cmd prompt that you launched the ...
7
votes
How to avoid google chrome proxy bypass for localhost?
Finally I've found a tricky solution for this. It was clear from the beginning that this is a browser issue, since I was able to make requests with curl --proxy.
The trick is that the DNS resolution ...
6
votes
How to find out what is running on localhost port
@Evan Anderson answer did not work for me cause I got a message
FIND: Parameter format not correct
so I replaced the Find call with a powershell Select-String
netstat -aon|sls 61456
TCP 127.0.0....
6
votes
Kill what ever is running on port 8080
Merging answers from above in one line: kill $(lsof -t -i:8080)
lsof -t returns the PID and passes that to kill.
6
votes
windows ssh localhost: connection refused
Update to this answer: you can now install OpenSSH Server using the Windows PowerShell. Here's a link to the instructions.
6
votes
Accepted
When listening to a port (taskserver) should the local address be `localhost` or `0.0.0.0`?
Sockets are configured to listen on a specific IP and Port. There are typically two primary configurations you would use for a Socket and a third that isn't as common, but comes in handy.
1) To only ...
6
votes
How can I configure firewalld to block all outgoing traffic except for specific ports while allowing localhost to access any of its own local ports?
The answer, I found by some trial and error, because searching for this exact (possibly odd) scenario on Google or elsewhere was fruitless:
# Allow all outbound traffic from localhost to localhost
...
5
votes
The easiest way to serve a page to localhost on OS X
Use your terminal, cd into your project folder then type:
npx http-server
That should start up a server for you and will be available on: http://127.0.0.1:8080 or follow the instructions on your ...
5
votes
Is there a default port that is requested by web browsers?
Default HTTP Port: 80
Default HTTPS Port: 443
Following is some of the recommended localhost ports for local developments.
Recommended Express.js(or LoopBack ) Dev Port: 3000, 8000, 8080 (by npm ...
5
votes
How to make shorter alias (shorthand) of 127.0.0.1 to simplify typing?
"0" as in ssh 0 or telnet 0
0 - on Linux system at least - means "an IP address of this machine", and if I understand correctly, it synonymous with hostname
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
localhost × 670networking × 159
apache-http-server × 99
macos × 58
windows × 50
dns × 46
windows-7 × 41
linux × 39
php × 36
google-chrome × 34
wamp × 34
ubuntu × 28
firefox × 28
xampp × 27
ip × 26
webserver × 26
mysql × 24
hosts-file × 23
windows-10 × 22
virtualbox × 22
proxy × 20
port × 20
ssh × 19
port-forwarding × 19
hosts × 19