I am trying to make a web proxy that is multi threaded. I can do a single threaded one just fine but when I try to use multi-threading it throws this error every time.
Traceback (most recent call last):
File "malwareProxy.py", line 25, in newClientInteraction
request = clientSocket.recv(BUFFLEN)
TypeError: 'member_descriptor' object is not callable
I have these imports:
import sys
import thread
from socket import *
And the important bits of code:
def newClientInteraction(clientSocket, addr):
try:
port = 80
request = clientSocket.recv(BUFFLEN)
....
serverListener = socket(AF_INET, SOCK_STREAM)
serverListener.bind(("", serverPort))
serverListener.listen(100)
print("\nProxy Server listening on port {0}...".format(serverPort))
# Start to listen for connections
while True:
(newsocket, addr) = serverListener.accept()
print("Connection made from: {0}".format(newsocket.getpeername()))
thread.start_new_thread(newClientInteraction, (socket, addr))
Please help. I am pretty new to python and have no idea why I am getting this error. I have looked at some other posts about this error and the answers seem to have to do with the programmer using multiple files and imports I am just using the one file. Thank you.