mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3320] [Feature Request] 希望Server Manage Plugins - NewWorkConn可以输出更多的信息 #2660
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#2660
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 @litrycn on GitHub (Feb 20, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3320
Describe the feature request
最近在使用frps Server Manage Plugins时发现:
在http代理被请求时,api没有返回被访问的NewWorkConn 没有给出被访问的代理名称、对端地址。
希望后续版本中能给出proxy_name或custom_domains、remote_addr。
在二次开发中 对remote_addr 和ip进行白名单校验(现在API只能实现对端口访问的proxy_name进行白名单,无法对web服务白名单化)
对于安全要求较高的web服务目前只能限制整个frpc连接,在使用时开放会给所有人访问
rdp请求,有给到对端地址:
{"version":"0.1.0","op":"NewUserConn","content":{"user":{"user":"asus","metas":{"user":"asus"},"run_id":"xxx"},"proxy_name":"asus.rdp","proxy_type":"tcp","remote_addr":"1.1.1.1:666"}}
http请求,没有给出访问者地址。 (http_user、http_pwd在实际使用中会与部分http服务的auth冲突)
{"version":"0.1.0","op":"NewWorkConn","content":{"user":{"user":"aws","metas":{"user":"aws"},"run_id":"xxx"},"run_id":"xxx"}}
目前 在frps的api(/api/proxy/http)中,对于离线的代理 api中的 conf字段为null,希望可以返回里面的metas信息,或者还是返回离线前的conf信息。(现在只能将每个代理信息全部存在数据库中)
相关:
https://github.com/gofrp/plugin
https://github.com/zfb132/frp_info
Describe alternatives you've considered
No response
Affected area
@fatedier commented on GitHub (Feb 20, 2023):
NewUserConn和NewWorkConn不是一回事。NewWorkConn是 frpc 到 frps 的连接。当 WorkConn 连接上来时并没有和具体的 proxy 绑定,而是会被加入连接池。之后当有需要的时候,例如对于 tcp 类型,当来了一个 userConn 的时候,会从连接池里取出一个 workConn 来使用。frps 中目前尽量不会存储不再使用的数据,否则会增加内存占用。有需要的话自己存储在自己的系统里是合理的。
@litrycn commented on GitHub (Feb 20, 2023):
在http类型代理被访问时,为什么没有NewUserConn信息呢?
@fatedier commented on GitHub (Feb 20, 2023):
实现机制不同,目前不能在此位置 hook。
@litrycn commented on GitHub (Feb 20, 2023):
frpc的http代理能否实现 黑白名单访问呢?
tcp类型在前两天,通过NewWorkConn成功发现阻止 丹麦等国IP的rdp爆破。
希望http代理也能支持部分指定IP才能访问,或者拉黑指定IP地址
@fatedier commented on GitHub (Feb 20, 2023):
如果是简单的 IP 过滤,就直接防火墙禁掉吧。
目前的实现和插件机制不太适合做这个,HTTP 是基于请求的,每一个请求去 hook,开销太大,而且本末倒置。这也是为什么会想要设计 v2 版本,期望是能够提供更多的可扩展性,而且能支持多种扩展方式,而不只是 rpc。
@litrycn commented on GitHub (Feb 20, 2023):
不行就算了,还是将重要的http服务用tcp做转发吧、然后通过NewWorkConn进行访问控制,只是多了个端口在后面。。。安全第一
@litrycn commented on GitHub (Feb 20, 2023):
如果是简单的 IP 过滤,就直接防火墙禁掉吧。 -- web服务不是我开发的,我看不到谁通过frp代理 访问了服务。
每一个请求去 hook,开销太大 --- 说的也是
还是用stcp 做转发吧,反正那几个web服务都只是在电脑上访问