2
我運行下面的代碼爲根,使用python2.6.1,平臺是Linux蟒蛇socket.error操作不允許
>>> import socket
>>> serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> serversocket.bind((socket.gethostname(), 80))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in bind
socket.error: [Errno 1] Operation not permitted
如何解決這個問題
您是否已經有一臺運行在80端口上的Web服務器? – geoffspear
作爲普通用戶,您無法綁定到低於1024的端口。你有沒有嘗試使用root權限? – Zagorax
我也試圖綁定它與端口8888仍然無法正常工作 – big