V2bX/node/inbound_test.go

35 lines
732 B
Go
Raw Normal View History

package node_test
2022-06-01 13:35:41 -04:00
import (
"github.com/Yuzuki616/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf"
. "github.com/Yuzuki616/V2bX/node"
2022-06-01 13:35:41 -04:00
"testing"
)
func TestBuildV2ray(t *testing.T) {
nodeInfo := &panel.NodeInfo{
NodeType: "v2ray",
NodeId: 1,
ServerPort: 1145,
Network: "ws",
NetworkSettings: nil,
Host: "test.test.tk",
ServerName: "test.test.tk",
}
certConfig := &conf.CertConfig{
CertMode: "none",
2022-06-01 13:35:41 -04:00
CertDomain: "test.test.tk",
Provider: "alidns",
Email: "test@gmail.com",
}
config := &conf.ControllerConfig{
ListenIP: "0.0.0.0",
2022-06-01 13:35:41 -04:00
CertConfig: certConfig,
}
_, err := BuildInbound(config, nodeInfo, "11")
2022-06-01 13:35:41 -04:00
if err != nil {
t.Error(err)
}
}