Quantcast
Channel: Active questions tagged simplehttpserver - Stack Overflow
Browsing all 80 articles
Browse latest View live

Is closing http.server.HTTPServer guaranteed to be thread-safe?

from http.server import HTTPServer, SimpleHTTPRequestHandlerimport threadingwith HTTPServer(("localhost", 8080), SimpleHTTPRequestHandler) as httpd: threading.Thread(target=httpd.serve_forever,...

View Article



How to reliably know that HTTPServer in a separate thread is up and serving?

I'm starting a HTTPServer object in a new thread:from http.server import HTTPServer, SimpleHTTPRequestHandlerimport threadingwith HTTPServer(("localhost", 8080), SimpleHTTPRequestHandler) as httpd:...

View Article

changing text properties as part of html script

I want to build a simple http server which receives list of text strings and sends simple dynamic html page which presents them in loop (similar to RSS)It works fine but now I want to control text...

View Article

Python3 SimpleHTTPServer error

I am using SimpleHTTPServer in Python 3.4.3python -m http.serverWhen I try to do a request from my client scryptdef download_file(url): local_filename = path_leaf(url) try: r = requests.get(url,...

View Article

Python 3 Simple Server exit() on request

I'm trying to create a simple http-file server, basically a simple extension of the SimpleHttpServer where it handles the files as usual but when a specific request is received ('/Done'), then the...

View Article


Why does my SimpleHTTPRequestHandler derived simple-server lock up?

I need help understanding what I'm doing wrong with this code. It is an IOT Over-the-air update server for a personal project I'm working on. Upon loading, it sends a POST command...

View Article

start python server from code with custom directory

Normally I would do this in a terminal:python3 -m http.server 8080 --directory path_to_the_dirI would like to call this from python instead. But without writing handlers or header responses or...

View Article

HttpHandler doesn't handle requests on a set URI

I tried making a java HTTP server using com.sun.net.httpserver.HttpServer. The code below is simplified. The program doesn't enter the lambda expression in createContext(String context, HttpHandler...

View Article


reading json from SimpleHttpServer json.decoder.JSONDecodeError

I am trying to create simple rest api with python without using third party library. I am taking the input from post request bu i can not convert the json to dictionary. json.load function gives an...

View Article


Loading module from was blocked because of a disallowed MIME type (“”)

I am going through a three.js example and when I use import within a javascript module I get the error:Loading module from “http://localhost:8000/build/three.module.js” was blocked because of a...

View Article

How do I shut down a python simpleHTTPserver?

So I'm trying to learn d3, and the wiki suggested that To view the examples locally, you must have a local web server. Any web server will work; for example you can run Python's built-in server:python...

View Article

Can I set a header with python's SimpleHTTPServer?

I'm using SimpleHTTPServer to test some webpages I'm working on. It works great, however I need to do some cross-domain requests. That requires setting a Access-Control-Allow-Origin header with the...

View Article

Enable access control on simple HTTP server

I have the following shell script for a very simple HTTP server:#!/bin/shecho "Serving at http://localhost:3000"python -m SimpleHTTPServer 3000I was wondering how I can enable or add a CORS header like...

View Article


How to run python with SimpleHttpRequestHandler

I'm using python3.I want to show a one page but I got 404 not found file:import pymysql.cursorsimport http.serverimport socketserverfrom furl import furlclass...

View Article

How do I kill SimpleHTTPServer from within a Python script?

I am trying to use http.server to test all the links in a Python project. I can get my script to work if I start the server before running my script, and then the server stops when I close the terminal...

View Article


Local server giving wrong files. Is it possible I'm running 2 python servers?

I'm in the directory /backbone/ which has a main.js file within scripts. I run python -m SimpleHTTPServer from the backbone directory and display it in the browser and the console reads the error $ is...

View Article

Create HTTP get response with attached binary data file and json formatted...

I'm using BaseHTTPServer.BaseHTTPRequestHandler in order to implement my server.currently I repsonse to get request with merely binary data file.self.send_response(200)self.send_header("Content-Type",...

View Article


Telegram HTML5 Game Bot returns blank page

First of all, I want to thank @enzo and @CallMeStag for helping me with my previous coding issues! As of right now, the Arcade Game Bot created originaly by Mark Powers, is running as intended with...

View Article

How to use Content-Encoding: gzip with Python SimpleHTTPServer

I'm using python -m SimpleHTTPServer to serve up a directory for local testing in a web browser. Some of the content includes large data files. I would like to be able to gzip them and have...

View Article

How to make an Android Web Server? [closed]

How do i make an application like kws which allows our handheld device to act as a server. It should be able to handle post request and host a web site. Any idea where I should start?

View Article
Browsing all 80 articles
Browse latest View live




Latest Images