macronut / phantomsocks

A cross-platform proxy client/server for Linux/Windows/macOS
GNU Lesser General Public License v3.0
452 stars 18 forks source link

After the update, the build prompts an error. #12

Closed ghost closed 2 years ago

ghost commented 2 years ago
go build -tags windivert

# github.com/macronut/phantomsocks
.\main.go:172:26: cannot use "" (type string) as type []string in argument to phantomtcp.ConnectionMonitor
.\main.go:240:23: undefined: devices
.\main.go:258:23: undefined: devices
ghost commented 2 years ago

https://github.com/Macronut/phantomsocks/blob/d09a5d22cd60f0d966bbe4981e02144aaad4f2b2/main.go#L166-L173

I try to modify it to:

    devices := []string{""}
    if StartFlags.Device != "" {
        devices = strings.Split(StartFlags.Device, ",")
        if !ptcp.ConnectionMonitor(devices) {
            return
        }
    } else {
        ptcp.ConnectionMonitor(devices)
    }

It looks like it can be compiled and used normally.

macronut commented 2 years ago

OK