barely working http proxy

This commit is contained in:
v2ray committed 2015-12-15 16:00:47 +01:00
1 parent d0a75ce9f3
commit e12e5a0ecb
10 files changed
+139 -31

No files matched your search

+3 -3
View File
@@ -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()
+2 -3
View File
@@ -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"))
}