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.

1287 questions
10
votes
5 answers

Http-Server Command Not Found After Install in NPM

i installed http-server with npm globally but still I get "command not found" what is wrong my npm command is that npm install -g http-server and http run command http-server -p 8000
Kamuran Sönecek
  • 3,293
  • 2
  • 30
  • 57
10
votes
2 answers

Haskell equivalent for python -m http.server?

Is there a way to start a http server to serve static files right from shell using ghc -e or runhaskell ?
Shanthakumar
  • 757
  • 6
  • 23
10
votes
1 answer

Does empty "Expect:" header mean anything?

Many libraries include Expect: 100-continue on all HTTP 1.1 POST and PUT requests by default. I intend to reduce perceived latency by removing 100-continue mechanism on the client side on those requests for which I know the expense of sending data…
Dima Tisnek
  • 11,241
  • 4
  • 68
  • 120
9
votes
4 answers

How to implement an HTTP server on android

I've two android applications on same LAN provided by WIFI : App (A) that open a listening socket on port 8033 App (B) that use HttpClient to access (A) on port 8033 How to make it possible that (A) may do POST and GET requests on (B)? What the…
KhanZeeshan
  • 1,410
  • 5
  • 23
  • 36
9
votes
2 answers

SimpleHTTPServer not found python3

I'm trying to write a simple server in python. So after watching tutorial, I'm trying to import a few modules. from http.server import HTTPServer from http.server import SimpleHTTPServer As the doc says, it has been moved, that's why i'm doing…
Danial
  • 542
  • 2
  • 9
  • 24
9
votes
5 answers

React router with http-server

we use react-roucter-dom with http-server , when user loads main page and click navigation links , new pages will loaded perfectly , but when user refresh page in that route , it returns 404 . It means HTML5 pushState is not working with…
SayJeyHi
  • 1,559
  • 4
  • 19
  • 39
9
votes
2 answers

npm http-server keeps caching my App.js

I'm learning AngularJS. I'm using npm http-server to run the project locally. The problem is, whenever I make changes to App.js the change doesn't get reflected on the site. I try refreshing the page, it doesn't update the changes to JS. I also…
AshleyKang
  • 93
  • 1
  • 1
  • 3
9
votes
2 answers

python3: UTF-8 encoding in http.server

I have encoding problems when serving a simple web page in python3, using BaseHTTPRequestHandler. Here is a working example: #!/usr/bin/python3 # -*- coding: utf-8 -* from http.server import BaseHTTPRequestHandler, HTTPServer from os import curdir,…
roipoussiere
  • 5,142
  • 3
  • 28
  • 37
9
votes
2 answers

Unable to view files in a browser with python http server

I am creating a python httpserver for a folder on remote machine using command : python -m SimpleHTTPServer 9999 But I am unable to view a file in the browser using this. As soon as click on the link the file gets downloaded. Is there a way to…
Nishant Lakhara
  • 2,295
  • 4
  • 23
  • 46
9
votes
1 answer

Where to throw customized 404 error in jersey when HttpServer can't find a resource

I want to customize 404 response, that the server (not me) throws whenever it can't find a requested resource, (or throw a customized WebApplicationException myself, if it's possible to test if a requested resource is present in one app? probably a…
Curcuma_
  • 851
  • 2
  • 12
  • 37
9
votes
2 answers

General (non-server-specific) HTTP server test suite?

I'm looking for a test suite to test an HTTP server for standards compliance. The test suite should therefor not be server-specific, like Apache's HTTP server test suite. Any pointer would be greatly appreciated. Regards, Jochen
Jochen
  • 7,270
  • 5
  • 24
  • 32
9
votes
2 answers

How to get client certificate in a Java HttpsServer implementation for a webservice?

I wrote a Web Service server using Sun Ws implementation and I used a HttpsServer for publication (TLS mutual authentication). httpServer=HttpsServer.create(...); ssl=SSLContext.getInstance("TLS"); ... …
8
votes
1 answer

Python http server for production

Python docs claim, that "http.server is not recommended for production. It only implements basic security checks." Is there another simple to use python server (like http.server) with "advanced" security check, ready for production? (I want to run…
Petr Marek
  • 595
  • 5
  • 19
8
votes
1 answer

Only one line of SimpleHTTPServer output does not appear while running container without '-it'

Note: I am not trying to solve any problem in a real project here. This question is intended for merely understanding the reason behind the results I see in the 2nd experiment (Experiment 2) below. These experiments were performed using Docker…
Lone Learner
  • 18,088
  • 20
  • 102
  • 200
8
votes
1 answer

Why cache-control HTTP header for requests?

I recently went through this article. It says that not only response, the requests can also include cache-control options. Though I understood, it can be utilized by server responses meaningfully, I don't clearly understand why they are needed in…
Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87