mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-10-24 17:20:21 +08:00
修订代码;将addr的赋值从各个proxy自己的方法中提出来
This commit is contained in:
@@ -8,18 +8,16 @@ import (
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
addr string
|
||||
tlsConfig *tls.Config
|
||||
}
|
||||
|
||||
func NewServer(hostAndPort, host, certFile, keyFile string, isInsecure bool) (*Server, error) {
|
||||
func NewServer(host, certFile, keyFile string, isInsecure bool) (*Server, error) {
|
||||
|
||||
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s := &Server{
|
||||
addr: hostAndPort,
|
||||
tlsConfig: &tls.Config{
|
||||
InsecureSkipVerify: isInsecure,
|
||||
ServerName: host,
|
||||
|
||||
Reference in New Issue
Block a user