Compare commits

...

4 Commits

Author SHA1 Message Date
fatedier
ce5a1e9cd7
Merge ced2fb69b799410c4147677dc82633041b5008fb into 32f09c4b606237f6543443ad56bdaac505a83053 2024-03-03 08:57:10 -07:00
fatedier
32f09c4b60
regen web assets (#4040) 2024-03-03 23:02:38 +08:00
Haotian Zou
f63b4d5c29
fix: change absolute path to relative path (#4038) 2024-03-03 22:57:17 +08:00
fatedier
ced2fb69b7 use math/rand/v2 2024-02-22 21:09:29 +08:00
6 changed files with 9 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>frps dashboard</title> <title>frps dashboard</title>
<script type="module" crossorigin src="./index-ky4re_ta.js"></script> <script type="module" crossorigin src="./index-Q42Pu2_S.js"></script>
<link rel="stylesheet" crossorigin href="./index-rzPDshRD.css"> <link rel="stylesheet" crossorigin href="./index-rzPDshRD.css">
</head> </head>

View File

@ -17,7 +17,7 @@ package nathole
import ( import (
"context" "context"
"fmt" "fmt"
"math/rand" "math/rand/v2"
"net" "net"
"slices" "slices"
"strconv" "strconv"
@ -341,7 +341,7 @@ func sendSidMessage(
TransactionID: transactionID, TransactionID: transactionID,
Sid: sid, Sid: sid,
Response: false, Response: false,
Nonce: strings.Repeat("0", rand.Intn(20)), Nonce: strings.Repeat("0", rand.IntN(20)),
} }
buf, err := EncodeMessage(m, key) buf, err := EncodeMessage(m, key)
if err != nil { if err != nil {
@ -398,7 +398,7 @@ func sendSidMessageToRandomPorts(
used := sets.New[int]() used := sets.New[int]()
getUnusedPort := func() int { getUnusedPort := func() int {
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
port := rand.Intn(65535-1024) + 1024 port := rand.IntN(65535-1024) + 1024
if !used.Has(port) { if !used.Has(port) {
used.Insert(port) used.Insert(port)
return port return port

View File

@ -20,7 +20,7 @@ import (
"crypto/subtle" "crypto/subtle"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
mathrand "math/rand" mathrand "math/rand/v2"
"net" "net"
"strconv" "strconv"
"strings" "strings"
@ -124,7 +124,7 @@ func RandomSleep(duration time.Duration, minRatio, maxRatio float64) time.Durati
if max <= min { if max <= min {
n = min n = min
} else { } else {
n = mathrand.Int63n(max-min) + min n = mathrand.Int64N(max-min) + min
} }
d := duration * time.Duration(n) / time.Duration(1000) d := duration * time.Duration(n) / time.Duration(1000)
time.Sleep(d) time.Sleep(d)

View File

@ -15,7 +15,7 @@
package wait package wait
import ( import (
"math/rand" "math/rand/v2"
"time" "time"
"github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/frp/pkg/util/util"

View File

@ -111,7 +111,7 @@ const formatTrafficOut = (row: BaseProxy, _: TableColumnCtx<BaseProxy>) => {
} }
const clearOfflineProxies = () => { const clearOfflineProxies = () => {
fetch('/api/proxies?status=offline', { fetch('../api/proxies?status=offline', {
method: 'DELETE', method: 'DELETE',
credentials: 'include', credentials: 'include',
}) })