Skip to content

Commit

Permalink
fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Sep 17, 2024
1 parent 1d515ce commit c8ecf9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions workers/gateway/gateway_interface_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ const (

var redirectOn = false

func getRouteListeningAddresses() []string {
if defaultListeningAddress == "" {
defaultListeningAddress = "127.0.0.1"
}
return []string{defaultListeningAddress}
}

func getRouteGatewayInterfaces() ([]int64, []string, error) {
defaultIP, err := gateway.DiscoverInterface()
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions workers/gateway/gateway_interface_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func init() {
panic("Tried to stop the WinDivert orphan instance but it did not terminate, unable to continue")
}

func getRouteListeningAddresses() []string {
if defaultListeningAddress == "" {
defaultListeningAddress = "127.0.0.1"
}
return []string{defaultListeningAddress}
}

// getRouteGatewayInterfaces method extracts routing information using the "netsh" utility and returns specifically:
// * Network Interface IDs list of all network interfaces configured
// * Network Address List for every configured interface
Expand Down
6 changes: 5 additions & 1 deletion workers/gateway/network_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gateway

import (
"github.com/Project-Faster/qpep/shared/logger"
"errors"
"github.com/Project-Faster/qpep/shared/logger"
"net/url"
"runtime"
"strings"
Expand Down Expand Up @@ -35,6 +35,10 @@ const (
QPEP_PROXY_HEADER = "X-QPEP-PROXY"
)

var (
errNotImplemented = errors.New("not implemented for OS: " + runtime.GOOS)
)

// init method executes the static initialization for detecting the current system's interfaces and addresses
func init() {
var err error
Expand Down

0 comments on commit c8ecf9b

Please sign in to comment.