diff --git a/Dockerfile.dev b/Dockerfile.dev index fd7850c..fe2b8a0 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -15,8 +15,8 @@ RUN wget http://www.tcpdump.org/release/libpcap-1.7.4.tar.gz && tar xzf libpcap- RUN go get github.com/google/gopacket RUN go get -u github.com/golang/lint/golint -WORKDIR /go/src/github.com/buger/goreplay/ -ADD . /go/src/github.com/buger/goreplay/ +WORKDIR /go/src/github.com/buger/gor-pro/ +ADD . /go/src/github.com/buger/gor-pro/ RUN wget http://archive.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.tar.gz && tar xzf commons-io-2.4-bin.tar.gz && cd commons-io-2.4 && mv commons-io-2.4.jar /tmp/ RUN wget http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.9-bin.tar.gz && tar xzf commons-codec-1.9-bin.tar.gz diff --git a/input_raw.go b/input_raw.go index 703b604..066c648 100644 --- a/input_raw.go +++ b/input_raw.go @@ -6,7 +6,7 @@ import ( "time" "github.com/buger/gor-pro/proto" - raw "github.com/buger/goreplay/raw_socket_listener" + raw "github.com/buger/gor-pro/raw_socket_listener" ) // RAWInput used for intercepting traffic for given address diff --git a/input_raw_test.go b/input_raw_test.go index 2fc8082..f4d5f01 100644 --- a/input_raw_test.go +++ b/input_raw_test.go @@ -106,11 +106,7 @@ func TestRAWInputNoKeepAlive(t *testing.T) { originAddr := listener.Addr().String() -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http", "") defer input.Close() output := NewTestOutput(func(data []byte) { @@ -156,11 +152,7 @@ func TestRAWInputIPv6(t *testing.T) { var respCounter, reqCounter int64 -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http", "") defer input.Close() output := NewTestOutput(func(data []byte) { @@ -211,11 +203,7 @@ func TestInputRAW100Expect(t *testing.T) { originAddr := strings.Replace(origin.Listener.Addr().String(), "[::]", "127.0.0.1", -1) -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "http", "") defer input.Close() // We will use it to get content of raw HTTP request @@ -278,11 +266,7 @@ func TestInputRAWChunkedEncoding(t *testing.T) { })) originAddr := strings.Replace(origin.Listener.Addr().String(), "[::]", "127.0.0.1", -1) -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, time.Second, "", "http", "") defer input.Close() replay := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -346,11 +330,7 @@ func TestInputRAWLargePayload(t *testing.T) { })) originAddr := strings.Replace(origin.Listener.Addr().String(), "[::]", "127.0.0.1", -1) -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http", "") defer input.Close() replay := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { @@ -395,11 +375,7 @@ func BenchmarkRAWInput(b *testing.B) { var respCounter, reqCounter int64 -<<<<<<< HEAD - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http") -======= - input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(originAddr, EnginePcap, true, testRawExpire, "", "http", "") defer input.Close() output := NewTestOutput(func(data []byte) { diff --git a/middleware_test.go b/middleware_test.go index 5cfe342..09d19d5 100644 --- a/middleware_test.go +++ b/middleware_test.go @@ -180,11 +180,7 @@ func TestTokenMiddleware(t *testing.T) { fromAddr := strings.Replace(from.Listener.Addr().String(), "[::]", "127.0.0.1", -1) // Catch traffic from one service -<<<<<<< HEAD - input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "http") -======= - input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "") ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 + input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "http", "") defer input.Close() // And redirect to another diff --git a/raw_socket_listener/listener.go b/raw_socket_listener/listener.go index c3fbff2..bbb0c0d 100644 --- a/raw_socket_listener/listener.go +++ b/raw_socket_listener/listener.go @@ -96,12 +96,7 @@ const ( EnginePcapFile ) -// NewListener creates and initializes new Listener object -<<<<<<< HEAD -func NewListener(addr string, port string, engine int, trackResponse bool, expire time.Duration, protocol TCPProtocol) (l *Listener) { -======= -func NewListener(addr string, port string, engine int, trackResponse bool, expire time.Duration, bpfFilter string) (l *Listener) { ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 +func NewListener(addr string, port string, engine int, trackResponse bool, expire time.Duration, protocol TCPProtocol, bpfFilter string) (l *Listener) { l = &Listener{} l.packetsChan = make(chan *packet, 10000) @@ -115,11 +110,8 @@ func NewListener(addr string, port string, engine int, trackResponse bool, expir l.respAliases = make(map[uint32]*TCPMessage) l.respWithoutReq = make(map[uint32]tcpID) l.trackResponse = trackResponse -<<<<<<< HEAD l.protocol = protocol -======= l.bpfFilter = bpfFilter ->>>>>>> d309650589a56db2bfa93c533337e3db1cfb0425 l.addr = addr _port, _ := strconv.Atoi(port)