Hello,
I have been trying to use BaseHTTPServer module from Python 2.2.2 distribution, but it looks like its not compatible with PyS60 1.4.4.
Do I have to make any modifications in BaseHTTPServer module to make it work?
Here's the code I'm using:
Code:
import BaseHTTPServer
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
if self.path != "/":
self.send_error(404, "File not found")
return
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
try:
self.wfile("hello world!")
except:
print("** ERROR!")
PORT = 8000
httpd = BaseHTTPServer.HTTPServer(("127.0.0.1", PORT), Handler)
print "** Serving at port", PORT
httpd.serve_forever()
And this is the error I get on the phone:
Code:
Version 1.4.4 final
Traceback (most recent call last):
File "E:\private\2000b1a5\default.py", line 81, in menu_action
f()
File "E:\private\2000b1a5\default.py", line 65, in query_and_exec
execfile(script_list[index][1].encode('utf-8'), script_namespace.namespace)
File "e:\python\http_server.py", line 24, in ?
httpd = BaseHTTPServer.HTTPServer(("127.0.0.1", PORT), Handler)
File "e:\python\lib\SocketServer.py", line 330, in __init__
self.server_bind()
File "e:\python\lib\BaseHTTPServer.py", line 102, in server_bind
host, port = self.socket.getsockname()[:2]
File "<string>", line 1, in getsockname
error: Not Implemented feature
I'm using the SocketServer and BaseHTTPServer from Python 2.2.2 distribution. I'd also like to use SimpleHTTPServer and CGIHTTPServer once I make this working.
Any help would be greatly appreciated.
// chall3ng3r //