diff --git a/bin/rakshasa.exe b/bin/rakshasa.exe index dde5b67..e235922 100644 Binary files a/bin/rakshasa.exe and b/bin/rakshasa.exe differ diff --git a/bin/rakshasa_darwin b/bin/rakshasa_darwin index ee1978c..768c862 100644 Binary files a/bin/rakshasa_darwin and b/bin/rakshasa_darwin differ diff --git a/bin/rakshasa_linux b/bin/rakshasa_linux index bc022b5..100dda2 100644 Binary files a/bin/rakshasa_linux and b/bin/rakshasa_linux differ diff --git a/server/conn.go b/server/conn.go index 4257642..970214a 100644 --- a/server/conn.go +++ b/server/conn.go @@ -348,6 +348,7 @@ func (conn *serverConnect) doConnectTcpWithHttpProxy(network common.NetWork, add conn.Close("读取http代理结果失败") return } + resdata = append(resdata, result[:n]...) l, _, err := parsereq(req, resdata) if err != nil { diff --git a/server/http_proxy.go b/server/http_proxy.go index 0662bec..d9847ed 100644 --- a/server/http_proxy.go +++ b/server/http_proxy.go @@ -199,9 +199,7 @@ func StartHttpProxyWithServer(cfg *common.Addr, n *node, id uint32, pool *httppo listenId: id, pool: pool, } - go handleHttpProxyLocal(s) - } }() return l, nil @@ -236,6 +234,7 @@ func handleHttpProxyLocal(s *httpProxyClient) { s.Close(err.Error()) return } + data = append(data, b[:n]...) //尝试读取一个http消息 l, _, err := parsereq(req, data) @@ -282,11 +281,10 @@ func handleHttpProxyLocal(s *httpProxyClient) { buf.WriteString("\r\n") } buf.WriteString("\r\n") - s.write2connect(buf.Bytes()) buf.Reset() bufPool.Put(buf) - return + } else { return } @@ -514,9 +512,9 @@ func parsereq(req *http1request, data []byte) (clen int, resdata []byte, err err err = fmt.Errorf("%+v", e) debug.PrintStack() } - }() + // method, path, proto line req.Proto = ""