问题
Environment
- macOS Big Sur 11.0.1 (20B29)
- System Firmware Version: 1554.50.3.0.0 (iBridge: 18.16.12561.0.0,0)
- MacBook Pro (15-inch, 2019) (
MacBookPro15,1
) - Using Proxifier (edit: resolved because of this. see answer below)
$ uname -a
Darwin MacBook-Pro.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
Problem
When tried to listen to any TCP port (tried TCP ports like 1
, 80
, 5555
, 10000
, 60000
) system complains
Protocol wrong type for socket
Where specifically, with netcat
:
$ nc -v -l 5555
nc: listen: Protocol wrong type for socket
and with Go code (go version: go version go1.13.7 darwin/amd64
):
package main
import (
"net"
)
func main() {
_, err := net.Listen("tcp", ":80")
if err != nil {
panic(err)
}
}
$ go run main.go
panic: listen tcp :80: listen: protocol wrong type for socket
Any help will be much appreciated! I can't do any development now on my Mac :(
回答1:
Ummmm ok this is embarrasing... Turns out that all of this is because I'm using Proxifier. Quitting the app resolved this problem.
I'll leave this here for anyone who fallen in this lol. :D
Update: Proxifier seems to be aware of this issue (see here). Turns out to be "a bug in Network Extension API" and Apple haven't been fixing it since September...
Workarounds proposed by Proxifier (ref)
- Start affected applications before Proxifier start
- Or bind the socket to
127.0.0.1
, not to `0.0.0.0
回答2:
It seems that the problem has been fixed by Apple in Big Sur 11.1 beta. The bug affects all applications that use NETransparentProxyProvider.
https://developer.apple.com/forums/thread/661610
It is not a fault of Proxifier.
回答3:
But it is a proxifier bug, since it should leave Direct connections alone - which it doesn't.
来源:https://stackoverflow.com/questions/64822795/cannot-listen-to-any-tcp-port-on-macos-big-sur-with-app-proxifier-protocol-wron