mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4077] 按示例配置后无法访问内网web端口 #3219
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @catxu on GitHub (Mar 17, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4077
Bug Description
公网使用阿里云esc,端口策略已打开,frps已配置并启动ok,访问dashbord正常,客户端使用docker启动,启动命令:
docker run --restart=always --network host -d -v /etc/frp/frpc.toml:/etc/frp/frpc.toml --name frpc snowdreamtech/frpc,其中frpc.toml配置如下:其中x.x.x.x为公网IP,已确认8009端口通过telnet可以连通:
通过浏览器访问公网地址+8009端口报错如下:
[E] [proxy/proxy.go:204] [ba21d2f089bb6106] [web] connect to local service [127.0.0.1:8009] error: dial tcp 127.0.0.1:8009: connect: connection refused. 浏览器直接访问 127.0.0.1:8009 可以正常显示页面内容。
frpc Version
0.55.1
frps Version
0.55.1
System Architecture
linux/x86_64
Configurations
frps.toml:
frpc.toml:
Logs
Steps to reproduce
...
Affected area
@liangyulai commented on GitHub (Mar 21, 2024):
你的frpc是用docker部署的,那么frpc.toml里localPort = 8009指向的是docker实例的8009端口
浏览器直接访问 127.0.0.1:8009,访问的是host的8009端口
所以你会看到frpc有错误日志:
[E] [proxy/proxy.go:204] [ba21d2f089bb6106] [web] connect to local service [127.0.0.1:8009] error: dial tcp 127.0.0.1:8009: connect: connection refused
你可以把docker网络设为host模式,或者把本地8009端口的服务与frpc部署在同一个docker实例,或者frpc不用docker
@catxu commented on GitHub (Mar 26, 2024):
感谢回复,我前面有提到,docker启动的是host模式,不过我尝试了不用docker起frpc就能访问正常,应该是镜像问题,issue不该提到这里,我关了。
@bling-yshs commented on GitHub (Apr 3, 2024):
我也遇到同样的问题了,解决方法是容器指定host模式,然后配置里IP填
host.docker.internal全配置: