Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix encryption and compresion in dashboard #3682

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Release.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
### Fixes

* Encryption and compression are not displayed correctly in the dashboard.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/frps/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<title>frps dashboard</title>
<script type="module" crossorigin src="./index-9465253b.js"></script>
<script type="module" crossorigin src="./index-c322b7dd.js"></script>
<link rel="stylesheet" href="./index-1e0c7400.css">
</head>

Expand Down
26 changes: 9 additions & 17 deletions web/frps/src/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ class BaseProxy {
this.type = ''
this.encryption = false
this.compression = false
if (proxyStats.conf != null && proxyStats.conf.useEncryption != null) {
this.encryption = proxyStats.conf.useEncryption
}
if (proxyStats.conf != null && proxyStats.conf.useCompression != null) {
this.compression = proxyStats.conf.useCompression
}
this.encryption = (proxyStats.conf?.transport?.useEncryption) || this.encryption;
this.compression = (proxyStats.conf?.transport?.useCompression) || this.compression;
this.conns = proxyStats.curConns
this.trafficIn = proxyStats.todayTrafficIn
this.trafficOut = proxyStats.todayTrafficOut
Expand Down Expand Up @@ -79,14 +75,12 @@ class HTTPProxy extends BaseProxy {
super(proxyStats)
this.type = 'http'
this.port = port
if (proxyStats.conf != null) {
if (proxyStats.conf.customDomains != null) {
this.customDomains = proxyStats.conf.customDomains
}
if (proxyStats.conf) {
this.customDomains = proxyStats.conf.customDomains || this.customDomains;
this.hostHeaderRewrite = proxyStats.conf.hostHeaderRewrite
this.locations = proxyStats.conf.locations
if (proxyStats.conf.subdomain != null && proxyStats.conf.subdomain != '') {
this.subdomain = proxyStats.conf.subdomain + '.' + subdomainHost
if (proxyStats.conf.subdomain) {
this.subdomain = `${proxyStats.conf.subdomain}.${subdomainHost}`
}
}
}
Expand All @@ -98,11 +92,9 @@ class HTTPSProxy extends BaseProxy {
this.type = 'https'
this.port = port
if (proxyStats.conf != null) {
if (proxyStats.conf.customDomains != null) {
this.customDomains = proxyStats.conf.customDomains
}
if (proxyStats.conf.subdomain != null && proxyStats.conf.subdomain != '') {
this.subdomain = proxyStats.conf.subdomain + '.' + subdomainHost
this.customDomains = proxyStats.conf.customDomains || this.customDomains;
if (proxyStats.conf.subdomain) {
this.subdomain = `${proxyStats.conf.subdomain}.${subdomainHost}`
}
}
}
Expand Down