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 ...
baelx's user avatar
  • 2,996
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? ...
u1686_grawity's user avatar
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 ...
bsplosion's user avatar
  • 339
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 ...
Pau Coma Ramirez's user avatar
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 ...
Kiruahxh's user avatar
  • 271
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.” ...
Giacomo1968's user avatar
  • 54.8k
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 ...
AutoBaker's user avatar
  • 1,673
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" 的配置 ...
lk_vc's user avatar
  • 236
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, ...
DavidPostill's user avatar
  • 157k
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:...
jws's user avatar
  • 260
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 ...
Adam Baxter's user avatar
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, ...
NotTheDr01ds's user avatar
  • 21.8k
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 ...
Jason Huebel's user avatar
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, ...
MyrionSC2's user avatar
  • 269
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 (...
Roberto Stelling's user avatar
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 ...
Bidanh999's user avatar
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 ...
Anaksunaman's user avatar
  • 17.2k
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 ...
Ron Maupin's user avatar
  • 3,425
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 ...
Marduk's user avatar
  • 288
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, ...
Malvineous's user avatar
  • 2,641
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 ...
CSM's user avatar
  • 1,164
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 ...
Crouching Kitten's user avatar
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....
Apostolis Bekiaris's user avatar
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.
Prashant's user avatar
  • 1,423
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.
AnneMz's user avatar
  • 161
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 ...
Andrew's user avatar
  • 558
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 ...
John T.'s user avatar
  • 321
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 ...
Michel Moraes's user avatar
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 ...
SuperStar518's user avatar
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
davidgo's user avatar
  • 70.6k

Only top scored, non community-wiki answers of a minimum length are eligible