This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from: http://stackoverflow.com/questions/934012/get-image-data-in-javascript | |
function getBase64Image(img) { | |
// Create an empty canvas element | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
// Copy the image contents to the canvas | |
var ctx = canvas.getContext("2d"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL. | |
- replace fpem with the location of your .pem server file. | |
- the default port is 443. | |
usage: python SimpleSecureHTTPServer.py | |
Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/ | |
License: PSF License |
NewerOlder