libXray icon indicating copy to clipboard operation
libXray copied to clipboard

vless reality serverNames 为null

Open pingProMax opened this issue 2 months ago • 1 comments

package main

import (
	"encoding/json"
	"fmt"

	share "github.com/xtls/libxray/share"
)

func main() {
	shareURL := `vless://[email protected]:443?encryption=none&security=reality&sni=example.com&fp=chrome&pbk=xxx&pqv=xxx&type=xhttp&host=example.com&path=%2Fpath&mode=auto#test`

	xrayJson, err := share.ConvertShareLinksToXrayJson(string(shareURL))

	b, _ := json.Marshal(xrayJson)
	fmt.Println(string(b))
	fmt.Println(err)
}


go run .\main.go
{"transport":null,"log":null,"routing":null,"dns":null,"inbounds":null,"outbounds":[{"protocol":"vless","sendThrough":"test","tag":"","settings":{"address":"127.0.0.1","port":443,"level":0,"email":"","id":"55764102-ddcc-414b-8f66-87084741298f","flow":"","seed":"","encryption":"none","reverse":null,"vnext":null},"streamSettings":{"address":null,"port":0,"network":"xhttp","security":"reality","tlsSettings":null,"realitySettings":{"masterKeyLog":"","show":false,"target":null,"dest":null,"type":"","xver":0,"serverNames":null,"privateKey":"","minClientVer":"","maxClientVer":"","maxTimeDiff":0,"shortIds":null,"mldsa65Seed":"","limitFallbackUpload":{"AfterBytes":0,"BytesPerSec":0,"BurstBytesPerSec":0},"limitFallbackDownload":{"AfterBytes":0,"BytesPerSec":0,"BurstBytesPerSec":0},"fingerprint":"chrome","serverName":"example.com","password":"xxx","publicKey":"xxx","shortId":"","mldsa65Verify":"xxx","spiderX":""},"rawSettings":null,"tcpSettings":null,"xhttpSettings":{"host":"example.com","path":"/path","mode":"auto","headers":null,"xPaddingBytes":"0","noGRPCHeader":false,"noSSEHeader":false,"scMaxEachPostBytes":"0","scMinPostsIntervalMs":"0","scMaxBufferedPosts":0,"scStreamUpServerSecs":"0","xmux":{"maxConcurrency":"0","maxConnections":"0","cMaxReuseTimes":"0","hMaxRequestTimes":"0","hMaxReusableSecs":"0","hKeepAlivePeriod":0},"downloadSettings":null,"extra":null},"splithttpSettings":null,"kcpSettings":null,"grpcSettings":null,"wsSettings":null,"httpupgradeSettings":null,"sockopt":null},"proxySettings":null,"mux":null,"targetStrategy":""}],"policy":null,"api":null,"metrics":null,"stats":null,"reverse":null,"fakeDns":null,"observatory":null,"burstObservatory":null,"version":null}
<nil>
`

pingProMax avatar Nov 16 '25 08:11 pingProMax

According to the README of REALITY , the serverNames field should be server-side inbounds config, which means the serverName list that client can use.

yiguodev avatar Nov 18 '25 04:11 yiguodev