Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go.mod: remove replace inet.af/tcpproxy => github.com/inetaf/tcpproxy #409

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
golang.org/x/sync v0.8.0
golang.org/x/sys v0.26.0
gvisor.dev/gvisor v0.0.0-20240826182512-9f3309e5b121
inet.af/tcpproxy v0.0.0-20220326234310-be3ee21c9fa0
)

require (
Expand All @@ -52,5 +51,3 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace inet.af/tcpproxy => github.com/inetaf/tcpproxy v0.0.0-20221017015627-91f861402626
2 changes: 1 addition & 1 deletion pkg/services/forwarder/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"sync"

"github.com/containers/gvisor-tap-vsock/pkg/sshclient"
"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
"github.com/containers/gvisor-tap-vsock/pkg/types"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"inet.af/tcpproxy"
)

type PortsForwarder struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/forwarder/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"net"
"sync"

"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
"gvisor.dev/gvisor/pkg/waiter"
"inet.af/tcpproxy"
)

const linkLocalSubnet = "169.254.0.0/16"
Expand Down
16 changes: 6 additions & 10 deletions vendor/inet.af/tcpproxy/tcpproxy.go → pkg/tcpproxy/tcpproxy.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copied from https://github.com/inetaf/tcpproxy/blob/91f861402626c6ba93eaa57ee257109c4f07bd00/tcpproxy.go

// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -81,16 +83,6 @@ type Proxy struct {
ListenFunc func(net, laddr string) (net.Listener, error)
}

// Matcher reports whether hostname matches the Matcher's criteria.
type Matcher func(ctx context.Context, hostname string) bool

// equals is a trivial Matcher that implements string equality.
func equals(want string) Matcher {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This unused function had to be removed to silence the linter)

return func(_ context.Context, got string) bool {
return want == got
}
}

// config contains the proxying state for one listener.
type config struct {
routes []route
Expand Down Expand Up @@ -372,11 +364,15 @@ func (dp *DialProxy) HandleConn(src net.Conn) {

if ka := dp.keepAlivePeriod(); ka > 0 {
if c, ok := UnderlyingConn(src).(*net.TCPConn); ok {
//nolint:errcheck
c.SetKeepAlive(true)
//nolint:errcheck
c.SetKeepAlivePeriod(ka)
}
if c, ok := dst.(*net.TCPConn); ok {
//nolint:errcheck
c.SetKeepAlive(true)
//nolint:errcheck
c.SetKeepAlivePeriod(ka)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/virtualnetwork/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"net/http"
"strconv"

"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
"github.com/containers/gvisor-tap-vsock/pkg/types"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
"inet.af/tcpproxy"
)

func (n *VirtualNetwork) Mux() *http.ServeMux {
Expand Down
45 changes: 0 additions & 45 deletions vendor/inet.af/tcpproxy/.travis.yml

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/inet.af/tcpproxy/CONTRIBUTING.md

This file was deleted.

202 changes: 0 additions & 202 deletions vendor/inet.af/tcpproxy/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/inet.af/tcpproxy/README.md

This file was deleted.

Loading
Loading