Questions tagged [httpserver]

An HTTP Server is any application which receives requests via the HTTP protocol and sends back the corresponding response to fulfill the request.

An HTTP Server is any application which receives requests via the HTTP protocol and sends back the corresponding response to fulfill the request. This is the main method used by websites to handle HTML pages, Stylesheets, Scripts, Images, and other various types of files and requests which a web page may request from the server. HTTP Servers also handle other attributes of such a request, such as Query Strings and Cookies.

1135 questions
1404
votes
6 answers

What is the Python 3 equivalent of "python -m SimpleHTTPServer"

What is the Python 3 equivalent of python -m SimpleHTTPServer?
ryanbraganza
  • 14,583
  • 3
  • 13
  • 23
359
votes
17 answers

simple HTTP server in Java using only Java SE API

Is there a way to create a very basic HTTP server (supporting only GET/POST) in Java using just the Java SE API, without writing code to manually parse HTTP requests and manually format HTTP responses? The Java SE API nicely encapsulates the HTTP…
asker
  • 3,615
  • 3
  • 13
  • 3
316
votes
13 answers

What is a faster alternative to Python's http.server (or SimpleHTTPServer)?

Python's http.server (or SimpleHTTPServer for Python 2) is a great way of serve the contents of the current directory from the command line: python -m http.server However, as far as web servers go, it's very slooooow... It behaves as though it's…
Drew Noakes
  • 266,361
  • 143
  • 616
  • 705
172
votes
14 answers

Get and Set a Single Cookie with Node.js HTTP Server

I want to be able to set a single cookie, and read that single cookie with each request made to the nodejs server instance. Can it be done in a few lines of code, without the need to pull in a third party lib? var http =…
Corey Hart
  • 9,548
  • 9
  • 38
  • 46
117
votes
12 answers

Build a simple HTTP server in C

I need to build a simple HTTP server in C. Any guidance? Links? Samples?
Nathan H
  • 44,105
  • 54
  • 154
  • 235
78
votes
4 answers

npm http-server with SSL

I'm using the npm package "http-server" (https://www.npmjs.com/package/http-server) to set up a simple webserver, but I cannot get it to use SSL. My command in package.json is http-server -p 8000 -o -S with a cert.pem and key.pem in my root…
delucasvb
  • 4,217
  • 2
  • 20
  • 30
68
votes
1 answer

How to silent/quiet HTTPServer and BasicHTTPRequestHandler's stderr output?

I am writing a simple http server as part of my project. Below is a skeleton of my script: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyHanlder(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) …
Hai Vu
  • 30,982
  • 9
  • 52
  • 84
38
votes
3 answers

How can I receive an uploaded file using a Golang net/http server?

I'm playing around with Mux and net/http. Lately, I'm trying to get a simple server with one endpoint to accept a file upload. Here's the code I've got so far: server.go package main import ( "fmt" "github.com/gorilla/mux" "log" …
user7179784
  • 381
  • 1
  • 3
  • 3
34
votes
1 answer

Why are request.URL.Host and Scheme blank in the development server?

I'm very new to Go. Tried this first hello, world from the documentation, and wanted to read the Host and Scheme from the request: package hello import ( "fmt" "http" ) func init() { http.HandleFunc("/", handler) } func handler(w…
moraes
  • 12,239
  • 7
  • 42
  • 58
32
votes
5 answers

Java class for embedded HTTP server in Swing app

I wish to embed a very light HTTP server in my Java Swing app which just accepts requests, performs some actions, and returns the results. Is there a very light Java class that I can use in my app which listens on a specified port for HTTP requests…
CodeAndCats
  • 6,372
  • 7
  • 38
  • 57
31
votes
7 answers

Are there languages/software that implements http status code 418?

I know that status code 418 was defined as a April Fools' joke, and "is not expected to be implemented by actual HTTP servers" as is stated on Wikipedia. But I would be interested if any of you knew of a language/webserver/IDE that supports it. I…
Levite
  • 15,387
  • 7
  • 47
  • 46
30
votes
2 answers

How to start http-server locally

I cloned angular seed which is using node http-server and it is working perfectly using following configuration. Command : npm start (from root of project) Following configuration in package.json file: "start": "http-server -a localhost -p 8000…
JS-JMS-WEB
  • 2,355
  • 3
  • 15
  • 23
25
votes
1 answer

Python HTTP Server/Client: Remote end closed connection without response error

I made simple HTTP Server using BaseHTTPRequestHandler. The problem is, that when I want to post some data using requests from client, I get ConnectionError. I did simple request from requests lib documentation. Also interesting thing is, that HTTP…
martin1337
  • 1,450
  • 2
  • 18
  • 55
25
votes
4 answers

How to obtain the query string in a GET with Java HttpServer/HttpExchange?

I am trying to create a simple HttpServer in Java to handle GET requests, but when I try to get the GET parameters for a request I noticed the HttpExchange class does not have a method for that. Does anybody know an easy way to read the GET…
Tibor
  • 551
  • 1
  • 5
  • 16
23
votes
5 answers

Python Desktop Application with the Browser as an interface?

I want to create an application that runs on the users computer, a stand-alone application, with installation and what-not, but I want the interface to be a browser, either internal and displayed as an OS window or external accessible using the…
Eli
  • 2,436
  • 7
  • 30
  • 37
1
2 3
75 76