```console
$./singBox.exe version
sing-box version 1.2-beta9-8d88cfa
Environment: go1.20.2 windows/amd64
Tags: with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_clash_api,with_conntrack,with_gvisor
Revision: 8d88cfa8eb1729a8233b43f4cd3de34afe3116cf
CGO: enabled
```
Server and client configuration file
服务端xray如下
```console
{
"log": {
"loglevel": "info"
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"stats": {},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true,
"statsOutboundUplink": true,
"statsOutboundDownlink": true
}
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api",
"sniffing": null
},
{
"tag": "Vless-TCP-XTLS",
"port": 443, // This is TLS entrypoint. This entrypoint does the SSL Termination then routes the request based on the Path or ALPN type.
"protocol": "vless",
"settings": {
"clients": [
{ "email": "general@vless-tcp-xtls", //Change to your own email
"id": "xxxxxxxxxxxxxxx", //Change to your own email
"flow": "xtls-rprx-vision",
"level": 0
}
],
"decryption": "none",
"fallbacks": [
{
// if the path was `/trojanws`, pass it to trojan-ws listener
"path": "/wdnmd",
"dest": 12001
},
{
// if the request's ALPN was HTTP2, pass it to trojan-tcp. (Also from trojan-tcp fallback to Nginx HTTP2)
"alpn": "h2",
"dest": "@trojan-tcp",
"xver": 2
},
{
// if not any other condition, pass it to Nginx HTTP1.1 listener
"dest": "/dev/shm/h1.sock",
"xver": 2
}
]
},
"streamSettings": {
"network": "tcp",
// If XTLS Vision is enabled, "security" must be "tls"
// If XTLS Direct is enabled, "security" must be "xtls"
"security": "tls",
// If XTLS Direct is enabled, "tlsSettings" should also be changed to "xtlsSettings"
"tlsSettings": {
"certificates": [
{
"ocspStapling": 3600, //The Xray version is not less than v1.3.0 to support configuring the time interval between OCSP stapling update and certificate hot reload. Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"certificateFile": "xxxxxx", // this is te fullchain (domain + any bundle). Make sure the permissions are correct (absolute path)
"keyFile": "xxxxs" // this is the private key of the cert. Make sure the permissions are correct (absolute path)
},
{
// more domains and therefore more certificates can be added to this `certificates` list
"ocspStapling": 3600,
"certificateFile": "xxxxx", // this is te fullchain (domain + any bundle). Make sure the permissions are correct (absolute path)
"keyFile": "xxxxy" // this is the private key of the cert. Make sure the permissions are correct (absolute path)
}
],
"minVersion": "1.2", //Xray version is not less than v1.1.4 to support configuring the minimum TLS version. Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"cipherSuites": "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", //Xray版本不小于v1.1.4才支持配置密码套件(若无RSA证书,可删除所有RSA算法的密码套件;无ECC证书, to remove cipher suites for all ECDSA algorithms.). Currently V2Ray does not support it. If you use V2Ray as the server, you must delete this configuration.
"alpn": [
"h2", //Enabling h2 connection needs to configure h2 fallback, otherwise inconsistency (streaking) is easily detected by the wall and blocked.
"http/1.1" //Enabling http/1.1 connection needs to configure http/1.1 fallback, otherwise inconsistency (streaking) is easily detected by the wall and blocked.
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
},
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TCP + http obfs (VLESS - VMESS - TROJAN - ShadowSocks) //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
"listen": "@trojan-tcp", //trojan+tcp listening process
"protocol": "trojan",
"settings": {
"clients": [
{
"email":"general@trojan-tcp",
"password": "xxxx",
"level": 0
}
],
"fallbacks": [
{
// if it was not a valid trojan reuqest, for example the trojan password was wrong, pass it to the NGINX HTTP2 cleartext UDS
"dest": "/dev/shm/h2c.sock",
"xver": 2 //Enable PROXY protocol sending, and send the real source IP and port to Nginx. 1 or 2 indicates the PROXY protocol version. Consistent with the above, configuration 2 is recommended.
}
]
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {
"acceptProxyProtocol": true
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
},
"tag": "direct"
},
{
"protocol": "freedom",
"tag": "direct2"
},
{
"protocol": "blackhole",
"tag": "blocked"
},
{
"tag": "DNS-Internal",
"protocol": "dns",
"settings": {
"address": "127.0.0.53",
"port": 53
}
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"outboundTag": "blocked",
"ip": [
"geoip:private"
]
}
]
}
}
```
Welcome
Description of the problem
在windows端连接vless+vision+普通tls时,会导致singbox直接报错退出,同平台xray-core 1.7.5正常 报错crash提示如下: panic: alloc bad size: 0
goroutine 1070 [running]: github.com/sagernet/sing/common/buf.(defaultAllocator).Get(0x3e19c5?, 0x1f577e0?) github.com/sagernet/sing@v0.1.9-0.20230317044231-85a9429eadb6/common/buf/alloc.go:42 +0x169 github.com/sagernet/sing/common/buf.Get(...) github.com/sagernet/sing@v0.1.9-0.20230317044231-85a9429eadb6/common/buf/pool.go:4 github.com/sagernet/sing/common/buf.NewSize(0x1f577e0?) github.com/sagernet/sing@v0.1.9-0.20230317044231-85a9429eadb6/common/buf/buffer.go:50 +0xa2 github.com/sagernet/sing/common/buf.StackNewSize(...) github.com/sagernet/sing@v0.1.9-0.20230317044231-85a9429eadb6/common/buf/buffer.go:85 github.com/sagernet/sing/common/bufio.(BufferedVectorisedWriter).WriteVectorised(0xc000287a40, {0xc00008ef98?, 0x0, 0xc0013b80d0?}) github.com/sagernet/sing@v0.1.9-0.20230317044231-85a9429eadb6/common/bufio/vectorised.go:72 +0x106 github.com/sagernet/sing-box/transport/vless.(VisionConn).Write(0xc00102bd40, {0xc0013b80d0?, 0x56, 0x8?}) github.com/sagernet/sing-box/transport/vless/vision.go:215 +0x4f6 github.com/sagernet/sing-box/transport/vless.(Conn).Write(0xc0003eb2c0?, {0xc0013b80d0?, 0x4358ce?, 0xc0003eb2c0?}) github.com/sagernet/sing-box/transport/vless/client.go:132 +0x206 crypto/tls.(Conn).write(0xc00025bc00, {0xc0013b80d0?, 0x5?, 0xcd?}) crypto/tls/conn.go:923 +0x10d crypto/tls.(Conn).writeRecordLocked(0xc00025bc00, 0x17, {0xc000696000, 0x40, 0x1000}) crypto/tls/conn.go:991 +0x354 crypto/tls.(Conn).Write(0x1b?, {0xc000696000, 0x40, 0x1000}) crypto/tls/conn.go:1186 +0x411 net/http.http2stickyErrWriter.Write({{0x15a0420?, 0xc00025bc00?}, 0xc000947820?, 0xc000e48d40?}, {0xc000696000, 0x40, 0x1000}) net/http/h2_bundle.go:7429 +0x149 bufio.(Writer).Flush(0xc00105cb00) bufio/bufio.go:628 +0x62 net/http.(http2Transport).newClientConn(0xc001028bd0, {0x15a0420?, 0xc00025bc00}, 0x0) net/http/h2_bundle.go:7773 +0xbe7 net/http.(http2Transport).NewClientConn(0x10000c0002e2768?, {0x15a0420?, 0xc00025bc00?}) net/http/h2_bundle.go:7693 +0x39 net/http.(http2addConnCall).run(0xc0003eb300, 0xc00029bfd0?, {0xc0009477e0, 0x1b}, 0xc0004badc0?) net/http/h2_bundle.go:919 +0x45 created by net/http.(http2clientConnPool).addConnIfNeeded net/http/h2_bundle.go:900 +0x2ca
Version of sing-box
客户端singbox使用最新dev-next编译,服务端使用xray-core 最新action
Server and client configuration file
服务端xray如下
客户端singbox如下
Server and client log file
xray服务端疑似日志
singbox疑似日志