# localhost 서버의 요청이 보이지 않는 경우

> Proxyman에 localhost:3000 요청이 보이지 않나요? Automatic Setup으로 Google Chrome의 localhost 트래픽을 캡처하거나, /etc/hosts 또는 localhost.proxyman.io를 사용하세요.

## 1. 문제 {#1-problem}

로컬에서 NodeJS, Ruby 또는 Python 백엔드를 **http://localhost:3000**에서 개발하고 있는데, Google Chrome이나 Safari에서 **http://localhost:3000**에 접속해도 Proxyman 앱에 트래픽이 나타나지 않습니다.

**왜 이런 일이 생길까요?** macOS에서는 기본적으로 localhost 요청이 시스템 HTTP 프록시를 거치지 않습니다. 따라서 Proxyman은 트래픽을 기록하지 않습니다.

![Google Chrome에서 localhost:4000이 열려 있지만 Proxyman 요청 목록은 비어 있는 화면](https://proxyman.com/docs/assets/capture_http_localhost_chrome_2.jpeg)

_localhost 트래픽은 기본적으로 Proxyman에 나타나지 않습니다_

## 2. 해결 방법 {#2-solution}

### 2.1 ✅ v6.3.0의 새로운 해결 방법 {#21--new-solution-for-v630}

Proxyman macOS v6.3.0부터는 다음이 가능합니다:

* /etc/hosts 파일을 수정하지 않고도 Google Chrome / Firefox에서 `http://localhost:3000` 또는 모든 localhost 트래픽을 캡처
* 클릭 한 번으로 동작합니다
* 튜토리얼: [Google Chrome에서 HTTP localhost 트래픽을 캡처하는 방법](https://proxyman.com/posts/how-to-capture-http-localhost-traffic-from-google-chrome)

#### 사용 방법 {#how-to-do-it}

1. Proxyman에서 **Setup** 메뉴 -> **Automatic Setup…** -> Web Browsers 섹션에서 **Google Chrome…**을 클릭합니다.
2. 새로운 Google Chrome 창이 열립니다.
3. 완료되었습니다. http://localhost:3000에 접속하면 Proxyman이 트래픽을 캡처합니다.

![Proxyman이 Google Chrome에서 보낸 localhost:3000 및 localhost:4000 요청을 캡처한 화면](https://proxyman.com/docs/assets/capture_http_localhost_chrome_1.jpeg)

_Google Chrome에서 localhost 트래픽 캡처_

### 2.2 기존 해결 방법 {#22-old-solution}

해결 방법은 두 가지입니다. 둘 중 하나를 따르세요.

#### 해결 방법 1: `/etc/hosts`에서 **localhost**를 도메인 이름으로 매핑  {#solution-1-map-localhost-to-a-domain-name-in-etchosts-}

1. Vim 또는 VS Code로 `/etc/hosts` 파일을 엽니다.

```
$ sudo vim /etc/hosts
```

2\. **IPv4**와 **IPv6** 모두에 대해 도메인 이름을 추가합니다 (`proxyman.debug`는 원하는 이름으로 바꿔도 됩니다)

```
127.0.0.1 proxyman.debug
::1 proxyman.debug
```

![VS Code에서 연 /etc/hosts 파일. proxyman.debug가 127.0.0.1과 ::1에 매핑되어 있음](https://proxyman.com/docs/assets/Screenshot%202023-09-01%20at%2022.11.30.png)

_/etc/hosts에 proxyman.debug 추가_

3\. `sudo` 권한으로 파일을 저장합니다.

4\. **http://proxyman.debug:3000**으로 localhost 서버에 접속합니다 (3000은 사용 중인 localhost 포트로 바꾸세요). 

5\. 이제 디버깅을 시작하세요!

> **노트:** `local`을 접미사로 사용하는 경우(예: proxyman.local)에는 Bypass Proxy List에서 `*.local`을 제거하세요 ([제거 방법](https://proxyman.com/docs/ko/troubleshooting/.local-doesnt-appear-in-proxyman#2-solution)).

#### 해결 방법 2: **localhost** 대신 **localhost.proxyman.io** 사용 {#solution-2-use-localhostproxymanio-instead-of-localhost}

Proxyman은 Cloudflare를 사용해 **localhost.proxyman.io**의 DNS를 127.0.0.1(localhost)로 설정합니다. 따라서 Proxyman은 평소와 같이 로컬 트래픽을 캡처할 수 있습니다 ✅ 

예를 들면 다음과 같습니다:

<table data-header-hidden><thead><tr><th width="374">기존 URL</th><th>새 URL</th></tr></thead><tbody><tr><td>기존 URL</td><td>새 URL</td></tr><tr><td>localhost:3000</td><td>localhost.proxyman.io:3000</td></tr><tr><td>localhost:8080</td><td>localhost.proxyman.io:8080</td></tr><tr><td>...</td><td>...</td></tr></tbody></table>
