Skip to content

Commit 3dfb26b

Browse files
committed
feat(server): show client addr
1 parent 9257e98 commit 3dfb26b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/model/HandleFrpMsg.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def timestamp_to_str(timestamp):
2222

2323
# 处理Login操作:frpc登录frps
2424
def login_operation(data):
25-
str_fmt = "frp-client登录\nfrp版本:{}\n系统类型:{}\n系统架构:{}\n登录时间:{}\n连接池大小:{}"
25+
str_fmt = "frp-client登录\nfrp版本:{}\n系统类型:{}\n系统架构:{}\n登录时间:{}\nIP端口:{}\n连接池大小:{}"
2626
txt = str_fmt.format(
2727
data['version'], data['os'],
28-
data['arch'], timestamp_to_str(data['timestamp']), data['pool_count']
28+
data['arch'], timestamp_to_str(data['timestamp']), data.get("client_address", "") ,data['pool_count']
2929
)
3030
return txt
3131

@@ -34,15 +34,15 @@ def login_operation(data):
3434
def newproxy_operation(data):
3535
run_id = data['user']['run_id']
3636
proxy_type = data['proxy_type']
37-
txt = "frp-client建立穿透代理\n主机ID:{}\n代理名称:{}\n代理类型:{}\n".format(
37+
txt = "frp-client建立穿透代理\n主机ID:{}\n代理名称:{}\n代理类型:{}".format(
3838
run_id, data['proxy_name'], proxy_type
3939
)
4040
if proxy_type in ["tcp", "udp"]:
4141
if 'remote_port' in data:
42-
txt += "远程端口:{}\n".format(data['remote_port'])
42+
txt += "\n远程端口:{}".format(data['remote_port'])
4343
elif proxy_type in ["http", "https"]:
4444
if 'subdomain' in data:
45-
txt += "子域名:{}.{}\n".format(data['subdomain'], subdomain_host)
45+
txt += "\n子域名:{}.{}".format(data['subdomain'], subdomain_host)
4646
return txt
4747

4848
# 处理NewUserConn操作:用户连接内网机器;用户(ssh)-->云服务器(frps)-->内网主机(frpc)

0 commit comments

Comments
 (0)