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
2
votes
1 answer

Random delays using Volley request

I'm using a Volley singleton to send POST messages to a NanoHTTPD server made in java. The messages are short and the process time is fast, and there are no more than 1 message at the same time. The problem is that randomly there are some delays in…
Mariano L
  • 1,809
  • 4
  • 29
  • 51
2
votes
0 answers

Android http server is intermittently slow to connect

I have implemented a simple web server on an android phone. I used an early version of nanohttpd, which seems adequate to the purpose. Intemittently (approx every 5-10 GET requests) the socket connection time blows out from under 50ms to 3-4…
Robbie Matthews
  • 1,404
  • 14
  • 22
2
votes
1 answer

SocketException in Nanohttpd

I want to play mp3 file from server server side code: if (uri.contains("mp3")) { FileInputStream fis = null; try { fis = new FileInputStream(audioFile.getAbsoluteFile()); } catch (FileNotFoundException e) { …
Rajesh Gauswami
  • 572
  • 7
  • 22
2
votes
1 answer

camera picture streaming as mjpeg with nanohttpd in android

I have created an app and using nanohttpd I could get info from the phone. I could open camera in the background and took the picture. But I cannot stream it as motion jpeg through nanohttpd. I have searched the answer on the Internet, but…
Sherzodbek
  • 296
  • 3
  • 9
2
votes
1 answer

How can I modify the code to upload multiple files using NanoHTTPD in Android?

I'm a beginner of NanoHTTPD, I learned the documents NanoHttpd save uploaded files and https://github.com/romsahel/simplewebserver The following code can upload a single file to android mobile phone via WiFi. Now I hope to upload multiple files to…
HelloCW
  • 843
  • 22
  • 125
  • 310
2
votes
0 answers

Read bytes in NanoHttpd post with octet-stream

I am using Nanohttpd in Android to create an app that receives bytes from other instance of the same app. In my case, my application works and send data normally to a web service, but when I tried to send data between two instance of this…
2
votes
1 answer

Local reference jquery script in nanohttpd (Android)

I'm working around a web service using nanohttpd. I've following files in assets folder (Android Studio): All works properly including the direct reference to JQuery: But…
Héctor Ortiz
  • 257
  • 1
  • 6
  • 17
2
votes
0 answers

Setting the http.nonProxyHosts programmatically in Android

So I have an embedded server (nanohttpd) running in my cordova-based android application and instead of pointing my webview to file://....index.html, I have it pointed to load the index.html from my local webserver…
Marc Tan
  • 118
  • 1
  • 5
2
votes
0 answers

Convert CipherInputStream to FileInputStream

I am using nano-httpd to play encrypted mp3 file. I want to play encrypted file on the fly. I apply decryption AES-256 and send the CipherInputStream file to NanoHttpd but it throws exception. Actually it requires FileInputStream. Errors are stated…
2
votes
1 answer

Nanohttpd and Android service

I try to catch in my android application an event sent with an http request. Tanks to nanohttpd, the following code is functioning correctly and I receive the Hello Word in response, but now, I don't know how to execute an action in my Android…
2
votes
1 answer

Unexpected HTTP 400 status code from NanoHTTPD on Android

Friends! I'm getting occasional and unexpected HTTP 400 responses from nanohttpd in my Android app. The error is following a specific pattern. I've been looking at this for some time now but I've come to the point where I need a different angle or…
dbm
  • 10,376
  • 6
  • 44
  • 56
2
votes
0 answers

NanoHttpd : Android : Socket - java.net.SocketException: sendto failed: EPIPE (Broken pipe)

I am new to NanoHttpd. I am using this to stream a video in Android. For just normal playing this works like a charm without any issue. But when I try to seek to different time in the VideoPlayer, immediatly I get the following error and it creates…
No8
  • 77
  • 1
  • 9
2
votes
1 answer

Serve 2 files simultaneously with Nanohttpd from Android device

I want to send local mp3 files from my device to Chromecast. I allready have a version of Nanohttpd running and it works well, i can play my songs on my tv without problems with: MediaMetadata mediaMetadata = new…
Juanjo
  • 298
  • 1
  • 15
2
votes
1 answer

How to send an image to Chromecast using NanoHTTPD

I want to serve a file, an image for example, to Chromecast. I used nanoHTTPD so I can reach the content via url and here is the code I use to get the url: private class WebServer extends NanoHTTPD { public WebServer() { super(8080); …
2
votes
1 answer

nanohttpd https server in android , android and ios browser connect fail

I try establish a https server in android for other phones to connect,but only iphone6 sometimes can connected , ipod ,android browser all failed to get the webserver content. (the browser message is fail to establish safe connect) I use nanohttpd's…
alisa
  • 21
  • 7