Skip to content

Instantly share code, notes, and snippets.

View aperfectcypher's full-sized avatar

aperfectcypher

  • Liège, Belgium
  • 01:40 (UTC +02:00)
View GitHub Profile
@aperfectcypher
aperfectcypher / SimpleHTTPServerWithUpload.py
Created May 20, 2021 14:58 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@aperfectcypher
aperfectcypher / httpServer.py
Last active September 11, 2022 15:49
Simple Python3 HTTP server
from http.server import HTTPServer, BaseHTTPRequestHandler
from io import BytesIO
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
self.wfile.write(b'Hello, world!')
@aperfectcypher
aperfectcypher / echoTcpServer.py
Last active May 26, 2020 07:52
Simple Python3 TCP echo server
#!/usr/bin/python3
# usage python3 echoTcpServer.py [bind IP] [bind PORT]
import socket
import sys
import string
import random
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)