<{% tplinclude "add_v2ray_form.html" nil | println %}>
diff --git a/main/resource/v2raylist.html b/main/resource/v2raylist.html
index 1b56afd..e4fe9cb 100644
--- a/main/resource/v2raylist.html
+++ b/main/resource/v2raylist.html
@@ -1,5 +1,6 @@
-
+
+
diff --git a/proxy_node.go b/proxy_node.go
index c72ac19..46547a7 100644
--- a/proxy_node.go
+++ b/proxy_node.go
@@ -63,60 +63,6 @@ func (p *ProxyNode) AddToPool(c *V2rayApiClient) error {
return err
}
-// func (p *ProxyNode) Active(localPort int, c *V2rayApiClient) error {
-// err := c.AddInbound(net.Port(localPort), TAG_OUTBOUND_ACTIVE, "http")
-// if err != nil {
-// return err
-// }
-// err = c.AddOutboundByV2rayNode(p.v2rayNode, TAG_OUTBOUND_ACTIVE)
-// if err != nil {
-// return err
-// }
-// p.status = 1
-// return err
-// }
-
-// func (p *ProxyNode) UnActive(c *V2rayApiClient) error {
-// err := c.RemoveOutbound(TAG_OUTBOUND_ACTIVE)
-// if err != nil {
-// return err
-// }
-// err = c.RemoveInbound(TAG_OUTBOUND_ACTIVE)
-// if err != nil {
-// return err
-// }
-// return err
-// }
-
-// func (p *ProxyNode) Start(path string) (err error) {
-// v := NewV2ray(path, p.LocalPort)
-// p.cmd, err = v.SetPort(p.LocalPort).SetNode(p.v2rayNode).Start()
-// if p.cmd != nil {
-// p.status = 1
-// }
-// fmt.Printf("\n---StartV2rayNode--i(%d)--Addr(%s)--Title(%s)--err(%v)---\n", p.Index, p.RemoteAddr, p.Title, err)
-// return
-// }
-
-// func (p *ProxyNode) KillPidByLocalPort() (hasPid int, killResult error) {
-
-// hasPid = miniutils.GetPidByPort(p.LocalPort)
-// if hasPid > 0 {
-// fmt.Printf("---proxyNode---KillPidByLocalPort(%d)---PID(%d)---\n", p.LocalPort, hasPid)
-// killResult = miniutils.KillPid(fmt.Sprintf("%d", hasPid))
-// return
-// }
-// return
-// }
-
-// func (p *ProxyNode) Stop() error {
-// err := p.cmd.Process.Kill()
-// if err == nil {
-// p.status = 0
-// }
-// return err
-// }
-
func (p *ProxyNode) Remove(c *V2rayApiClient, tag string) error {
if tag == "" {
tag = p.GetId()
diff --git a/v2ray_api.go b/v2ray_api.go
index e2376d5..b16d8b5 100644
--- a/v2ray_api.go
+++ b/v2ray_api.go
@@ -75,12 +75,18 @@ func (a V2rayApiClient) AddInbound(inport net.Port, intag, protocol string) erro
protocol = strings.ToLower(protocol)
if protocol == "http" {
proxySet = &http.ServerConfig{
- // AllowTransparent: true,
- UserLevel: 0,
+ AllowTransparent: false,
+ Timeout: 30,
+ // UserLevel: 0,
}
}
if protocol == "socks" {
- proxySet = &socks.ServerConfig{UserLevel: 0}
+ proxySet = &socks.ServerConfig{
+ AuthType: socks.AuthType_NO_AUTH,
+ UdpEnabled: true,
+ // Address: net.NewIPOrDomain(net.AnyIP),
+ // UserLevel: 0,
+ }
}
resp, err := a.c.AddInbound(a.ctx, &pros.AddInboundRequest{Inbound: &v5.InboundHandlerConfig{
diff --git a/v2ray_config.go b/v2ray_config.go
index a6d75da..b1e85c8 100644
--- a/v2ray_config.go
+++ b/v2ray_config.go
@@ -245,7 +245,8 @@ func setV2rayConfigV4Inbounds(confv4 *V2rayConfigV4, inPort int, cf conf.Conf) {
protcl = "socks"
}
if protcl == "socks" {
- inset1 = `{"auth":"noauth","ip":"127.0.0.1","udp":true}`
+ // inset1 = `{"auth":"noauth","ip":"127.0.0.1","udp":true}`
+ inset1 = `{"auth":"noauth","udp":true}`
}
inbd1 := V2rayInbound{
Protocol: protcl,