2023-05-15 21:15:29 -04:00
|
|
|
package node_test
|
2022-06-01 13:35:41 -04:00
|
|
|
|
|
|
|
import (
|
2022-08-16 01:04:33 -04:00
|
|
|
"github.com/Yuzuki616/V2bX/api/panel"
|
2023-05-21 22:36:10 -04:00
|
|
|
"github.com/Yuzuki616/V2bX/conf"
|
2023-05-15 21:15:29 -04:00
|
|
|
. "github.com/Yuzuki616/V2bX/node"
|
2022-06-01 13:35:41 -04:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBuildV2ray(t *testing.T) {
|
2022-08-16 01:04:33 -04:00
|
|
|
nodeInfo := &panel.NodeInfo{
|
2023-05-21 22:36:10 -04:00
|
|
|
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",
|
|
|
|
}
|
2023-05-21 22:36:10 -04:00
|
|
|
config := &conf.ControllerConfig{
|
|
|
|
ListenIP: "0.0.0.0",
|
2022-06-01 13:35:41 -04:00
|
|
|
CertConfig: certConfig,
|
|
|
|
}
|
2023-05-21 22:36:10 -04:00
|
|
|
_, err := BuildInbound(config, nodeInfo, "11")
|
2022-06-01 13:35:41 -04:00
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|