yps_baslat6.sh
This commit is contained in:
parent
4ac1740eb4
commit
8a11146c7f
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import socket
|
||||||
|
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||||
|
|
||||||
|
class MyHandler(SimpleHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
if self.path == '/ip':
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-type', 'text/html')
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write('ip adresiniz %s' % self.client_address[0])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
return SimpleHTTPRequestHandler.do_GET(self)
|
||||||
|
|
||||||
|
class HTTPServerV6(HTTPServer):
|
||||||
|
address_family = socket.AF_INET6
|
||||||
|
|
||||||
|
def main():
|
||||||
|
server = HTTPServerV6(('::', 8000), MyHandler)
|
||||||
|
server.serve_forever()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue