doc: add Hysteria2 doc

This commit is contained in:
gVisor bot 2023-09-21 10:43:45 +08:00
parent 7df4e115de
commit a15d43221d
3 changed files with 22 additions and 3 deletions

View file

@ -11,7 +11,6 @@ import (
"net" "net"
"net/netip" "net/netip"
"os" "os"
"regexp"
"strconv" "strconv"
"time" "time"
@ -43,8 +42,6 @@ const (
DefaultHopInterval = 10 DefaultHopInterval = 10
) )
var rateStringRegexp = regexp.MustCompile(`^(\d+)\s*([KMGT]?)([Bb])ps$`)
type Hysteria struct { type Hysteria struct {
*Base *Base

View file

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"net" "net"
"net/netip" "net/netip"
"regexp"
"strconv" "strconv"
"sync" "sync"
@ -123,6 +124,8 @@ func safeConnClose(c net.Conn, err error) {
} }
} }
var rateStringRegexp = regexp.MustCompile(`^(\d+)\s*([KMGT]?)([Bb])ps$`)
func stringToBps(s string) uint64 { func stringToBps(s string) uint64 {
if s == "" { if s == "" {
return 0 return 0

View file

@ -642,6 +642,25 @@ proxies: # socks5
# fingerprint: xxxx # fingerprint: xxxx
# fast-open: true # 支持 TCP 快速打开,默认为 false # fast-open: true # 支持 TCP 快速打开,默认为 false
#hysteria2
- name: "hysteria2"
type: hysteria2
server: server.com
port: 443
# up和down均不写或为0则使用BBR流控
# up: "30 Mbps" # 若不写单位,默认为 Mbps
# down: "200 Mbps" # 若不写单位,默认为 Mbps
password: yourpassword
# obfs: salamander # 默认为空如果填写则开启obfs目前仅支持salamander
# obfs-password: yourpassword
# sni: server.com
# skip-cert-verify: false
# fingerprint: xxxx
# alpn:
# - h3
# ca: "./my.ca"
# ca-str: "xyz"
# wireguard # wireguard
- name: "wg" - name: "wg"
type: wireguard type: wireguard