Chore: use alpn http 1.1 only on trojan websocket by default
This commit is contained in:
parent
967932d02c
commit
c6cceeb0c5
1 changed files with 5 additions and 3 deletions
|
@ -23,6 +23,8 @@ const (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultALPN = []string{"h2", "http/1.1"}
|
defaultALPN = []string{"h2", "http/1.1"}
|
||||||
|
defaultWebsocketALPN = []string{"http/1.1"}
|
||||||
|
|
||||||
crlf = []byte{'\r', '\n'}
|
crlf = []byte{'\r', '\n'}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -74,7 +76,7 @@ func (t *Trojan) StreamConn(conn net.Conn) (net.Conn, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Trojan) StreamWebsocketConn(conn net.Conn, wsOptions *WebsocketOption) (net.Conn, error) {
|
func (t *Trojan) StreamWebsocketConn(conn net.Conn, wsOptions *WebsocketOption) (net.Conn, error) {
|
||||||
alpn := defaultALPN
|
alpn := defaultWebsocketALPN
|
||||||
if len(t.option.ALPN) != 0 {
|
if len(t.option.ALPN) != 0 {
|
||||||
alpn = t.option.ALPN
|
alpn = t.option.ALPN
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue