[GH-ISSUE #3944] 使用NPM+FRP,公网ip可以成功,localhost失败? #3132

Closed
opened 2026-05-05 14:01:34 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @A-sunny-boy on GitHub (Jan 22, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/3944

Bug Description

阿里云作为公网服务器,使用frp对内网的http服务进行代理,然后在阿里服务器上使用NPM根据域名进行流量转发。
阿里云frps配置

......
vhostHttpPort = 1111
......                        

内网frpc配置

[[proxies]]
name = "gettint-start"
type = "http"
localPort = 3000
customDomains = ["my.domain.xyz"]

使用NPM将流量转发到阿里云服务器的公网ip时,可以使用在公网使用my.domain.xyz访问到内网服务,NPM配置如下:
image

使用NPM将流量转发到localhost或127.0.0.1时,出现502。
image
image

请问如何内内网ip访问呢?

frpc Version

0.53.2

frps Version

0.53.2

System Architecture

linux/amd64

Configurations

frps
......
vhostHttpPort = 1111
......

frpc

[[proxies]]
name = "gettint-start"
type = "http"
localPort = 3000
customDomains = ["my.domain.xyz"]

Logs

No log

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @A-sunny-boy on GitHub (Jan 22, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/3944 ### Bug Description 阿里云作为公网服务器,使用frp对内网的http服务进行代理,然后在阿里服务器上使用NPM根据域名进行流量转发。 阿里云frps配置 ```toml ...... vhostHttpPort = 1111 ...... ``` 内网frpc配置 ```toml [[proxies]] name = "gettint-start" type = "http" localPort = 3000 customDomains = ["my.domain.xyz"] ``` 使用NPM将流量转发到阿里云服务器的公网ip时,可以使用在公网使用`my.domain.xyz`访问到内网服务,NPM配置如下: ![image](https://github.com/fatedier/frp/assets/12973547/f8ab0701-c565-48fc-97ac-7c0bbbccd9a3) 使用NPM将流量转发到localhost或127.0.0.1时,出现502。 ![image](https://github.com/fatedier/frp/assets/12973547/a00f4e8f-93a6-4f32-a7e9-3d7614ce7b78) ![image](https://github.com/fatedier/frp/assets/12973547/cee8181c-e48f-4a2c-aa59-7b53dad3c3a4) 请问如何内内网ip访问呢? ### frpc Version 0.53.2 ### frps Version 0.53.2 ### System Architecture linux/amd64 ### Configurations frps ...... vhostHttpPort = 1111 ...... frpc ```toml [[proxies]] name = "gettint-start" type = "http" localPort = 3000 customDomains = ["my.domain.xyz"] ``` ### Logs No log ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [X] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 14:01:34 -06:00
Author
Owner

@superzjg commented on GitHub (Jan 23, 2024):

服务端配置参数写错,先阅读文档...

<!-- gh-comment-id:1906013741 --> @superzjg commented on GitHub (Jan 23, 2024): 服务端配置参数写错,先阅读文档...
Author
Owner

@xqzr commented on GitHub (Jan 28, 2024):

Try ::1

<!-- gh-comment-id:1913644689 --> @xqzr commented on GitHub (Jan 28, 2024): Try `::1`
Author
Owner

@ezewu commented on GitHub (Feb 1, 2024):

解决没有,我也碰到这问题,外网可以访问,用内网就不行

<!-- gh-comment-id:1921386063 --> @ezewu commented on GitHub (Feb 1, 2024): 解决没有,我也碰到这问题,外网可以访问,用内网就不行
Author
Owner

@github-actions[bot] commented on GitHub (Feb 23, 2024):

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1960571274 --> @github-actions[bot] commented on GitHub (Feb 23, 2024): Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3132
No description provided.