Questions tagged [nanohttpd]

NanoHttpd is a light-weight HTTP server designed for embedding in other applications. NanoHttpd has been released under a Modified BSD licence.

The first version of NanoHttpd was published in 2003. Originally, its author was looking for:

"a small enough, embeddable and easily modifiable HTTP server that I could just copy and paste into my other Java projects."

Later, another team took the project and fixed a number of bugs, moved the build to maven and pulled out the samples from the runtime JAR to further slim it down.

The two projects pooled resources in early 2013, merging code-bases, to better support the user base and reduce confusion over why two NanoHttpd projects existed.

You can view the project on GitHub: https://github.com/NanoHttpd/nanohttpd.

247 questions
3
votes
2 answers

How to analyze httpd (apache webserver) logs in CentOS 7

I have configred a static IP on my server that is using CentOS 7. Here httpd is the webserver. Now I have to analyze following things. Total number of queries per day (or toall) Total requests sent and served. Unique visitors details List of…
Hafiz Muhammad Shafiq
  • 8,168
  • 12
  • 63
  • 121
3
votes
1 answer

How do I use nanohttpd websockets from a client app?

I have implemented a websocket server using nanohttpd in java. I can access the websocket server from js in a web page. It works great. However, now I'd like to create a java based client that will connect to the same server. Does nanohttpd have a…
Mark M
  • 1,807
  • 2
  • 21
  • 40
3
votes
0 answers

Mp4 playback using JwPlayer inside a WebView

I'm using an http server inside my application (using nanohttpd) which serves a page that has a video element which plays video using JwPlayer. The video type is .mp4. The problem is that I am not able to correctly reproduce the video in my Samsung…
jsc
  • 168
  • 1
  • 8
3
votes
0 answers

Use NanoHTTPD a proxy while streaming

I want to cache a stream before feeding it to Androids mediaplayer. My idea is to feed the android mediaplayer a link to nanohttpd which will then open a connection to the remote webserver and forward the stream to the mediaplayer. Meanwhile I will…
Markus
  • 2,526
  • 4
  • 28
  • 35
3
votes
0 answers

Refering files from assets in Android for NanoHttpD

I am trying to use NanoHTTP to serve up an HTML file with help of Android. Currently i'm able to do display the page. I'm also new to andriod. The issue is not having a clear picture how to refer the images and css for that html file even after i…
Arun
  • 1,010
  • 6
  • 18
  • 37
3
votes
1 answer

nanohttpd in android wont work

I tried to get nanohttpd working under android. I have used this example: package com.example.android_test; import java.io.IOException; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import…
Gizmo
  • 871
  • 1
  • 15
  • 38
2
votes
1 answer

simple web server in java called nanohttpd

How to code a simple,light weight web server in java which can take HTTP requests, runs HTML forms and returns requested pages. Im trying to integrate this server as a part of run time library of a newly developed language. I have got this one…
YBV
  • 31
  • 1
2
votes
2 answers

java ssl: chrome / firefox sends "G" in http header instead of "GET / HTTP/1.1"

Hi I am trying out a simple java http server NanoHTTPD: http://elonen.iki.fi/code/nanohttpd/ Today I try to support it with HTTPS, so I create SSLServerSocket in its NanoHTTPD constructor: // myServerSocket = new…
Calvin Lee
  • 97
  • 1
  • 7
2
votes
0 answers

How to start play .mkv and .mp4 videos on Mi Video using NanoHttpd without reading the entire file (Android)

I'm using NanoHttpd library in order to serve video files of type .mkv and .mp4 on Mi Video. As the reading of the input stream was too slow, I changed NanoHttpd's reading buffer size to 1M: private void sendBody(OutputStream outputStream, long…
2
votes
1 answer

Add arguments to RouterNanoHTTPD Handler

I'm using NanoHTTPD's RouterNanoHTTPD to add route mappings. Calling addRoute(String uri, Class handler, Object ... params) does not call the parameterized constructor to instantiate an object of the Class handler. Has anyone been able to do…
Crearo Rotar
  • 559
  • 7
  • 23
2
votes
1 answer

Can't establish connection to localhost when offline

I build a webserver on my android device by NanoHttpd or ServerSocket and connect to this server from itself. It run good when device is online. But I can't receive request when device isn't online. I was try connect to localhost or 127.0.0.1 but…
Luc Le
  • 196
  • 9
2
votes
0 answers

NanoHTTP as windows service with Apache Commons Daemon

I made a small HTTP listener with NanoHTTP library, I would like to use it with Apache Commons Daemon (https://commons.apache.org/proper/commons-daemon/index.html) to install with procrun as Windows service. I read the docs but I cannot understand…
Tobia
  • 9,165
  • 28
  • 114
  • 219
2
votes
1 answer

Embedded web server NanoHTTPD Response serve method not being called

I have this web server class: private class WebServer extends NanoHTTPD { public WebServer() { super(PORT); Log.i("myTag", "THIS IS RUNNING2"); } @Override public Response serve(String uri, Method method,…
Billy Kong
  • 31
  • 4
2
votes
1 answer

NanoHTTPD - convert https stream to http

To overcome Chromecast's restriction on streaming from self-certificated https servers (in my case the Subsonic music server) I'm utilizing an instance of the NanoHTTPD server already running as part of my Android app. The idea is to stream from the…
milleph
  • 462
  • 5
  • 20
2
votes
0 answers

Create Remote HttpServer using nanoHttpd

I am creating a httpserver using NanoHttpd library. When I am running it on local it is working fine. but when i am trying to create httpserver using Hostname.This is giving following Error. bind failed: EADDRNOTAVAIL (Cannot assign requested…