mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-03 00:22:05 +00:00
barely working http proxy
This commit is contained in:
1 parent
d0a75ce9f3
commit
e12e5a0ecb
10 files changed
+139
-31
No files matched your search
@@ -78,9 +78,9 @@ func (this *FreedomConnection) Dispatch(firstPacket v2net.Packet, ray ray.Outbou
|
||||
}
|
||||
|
||||
writeMutex.Lock()
|
||||
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
||||
tcpConn.CloseWrite()
|
||||
}
|
||||
//if tcpConn, ok := conn.(*net.TCPConn); ok {
|
||||
// tcpConn.CloseWrite()
|
||||
//}
|
||||
readMutex.Lock()
|
||||
conn.Close()
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package freedom
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
@@ -127,9 +126,9 @@ func TestSocksTcpConnect(t *testing.T) {
|
||||
tcpConn.CloseWrite()
|
||||
}
|
||||
|
||||
dataReturned, err := ioutil.ReadAll(conn)
|
||||
dataReturned, err := v2net.ReadFrom(conn, nil)
|
||||
assert.Error(err).IsNil()
|
||||
conn.Close()
|
||||
|
||||
assert.Bytes(dataReturned).Equals([]byte("Processed: Data to be sent to remote"))
|
||||
assert.Bytes(dataReturned.Value).Equals([]byte("Processed: Data to be sent to remote"))
|
||||
}
|
||||
Reference in new issue
Block a user