"TypeError: 'tuple' object is not callable"

473 views Asked by At

So i am trying to make a Growtopia Server Emulator but i actually got this confusing error. I couldn't find anything about...

Here's my code

import cgi #not used yet
import http.server
import logging #not used yet
import socketserver

class ServerHandler(http.server.BaseHTTPRequestHandler):
         def do_POST(self):
             self.send_response(200)
             self.end_headers()
             self.wfile.write("server|127.0.0.1\nport|17091\ntype|1\n#maint|Mainetrance message (Not used for now) -- Growtopia Noobs\n\nbeta_server|127.0.0.1\nbeta_port|17091\n\nbeta_type|1\nmeta|localhost\nRTENDMARKERBS1001")
         def do_GET(self):
             self.send_response(200)
             self.end_headers()
             self.wfile.write("server|127.0.0.1\nport|17091\ntype|1\n#maint|Mainetrance message (Not used for now) -- Growtopia Noobs\n\nbeta_server|127.0.0.1\nbeta_port|17091\n\nbeta_type|1\nmeta|localhost\nRTENDMARKERBS1001")
         def log_message(self, format, *args):
             return
PORT = 80
HOST = ""

Handler = http.server.SimpleHTTPRequestHandler,ServerHandler

OUT_HOST = HOST
httpd = socketserver.TCPServer((HOST, PORT), Handler)
print("Server Port : ", PORT)
if OUT_HOST == "" or " " or "\n":
 print("Server Hostname : ", "localhost")
else:
 print("Server Hostname : ", HOST)

httpd.serve_forever()


1

There are 1 answers

0
isGrounded On BEST ANSWER

I fixed that issue by Adding Handler = http.server.SimpleHTTPRequestHandler into ServerHandler Class.