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
1
vote
1 answer

Error with latest jar of Nanohttpd

I followed the SO for setting NanoHttpd to serve files from here - How to serve a mp3 file using latest NanoHTTPD 2.3.0 in Android? This works but I require the use the latest version from Github, because it handles more HTTP methods and is required…
arjun
  • 1,594
  • 16
  • 33
1
vote
1 answer

Nanohttpd exits immediately when run in Docker container

I wrote a simple microservice in Java using nanohttpd for the HTTP server. I am able to run it from the jar file directly from the Windows 10 command prompt like this: D:\Docker\JoeMicroserviceTest\src>java -jar…
JoeMjr2
  • 3,804
  • 4
  • 34
  • 62
1
vote
1 answer

NanoHTTPD server in Android with SSL: "Wrong version of key store"

I'm trying to run a HTTPS server in Android with NanoHTTPD and I'm obtaining the IOException "Wrong version of key store". Explication: HTTP work fine When use HTTP (no HTTPS) all work fine, my code: try { WebServer webServer = new…
Artificioo
  • 704
  • 1
  • 9
  • 19
1
vote
0 answers

NanoHTTPD Web Server that serves files not applying resources

I have a simple web server that I need to serve files from the external drive so the URL would be something like localhost:8080/map/landing.html. This is the serve method that is invoked when you change URLs: @Override public Response…
Billy Kong
  • 31
  • 4
1
vote
0 answers

fi.iki.elonen.NanoHTTPD: Could not send response to the client,java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) #444

i am using NanoHttpd to serve the videos in my android application but i am getting the below error please help me. fi.iki.elonen.NanoHTTPD: Could not send response to the client java.net.SocketException: sendto failed: ECONNRESET (Connection…
1
vote
0 answers

NanoHttpd : File Not Found when trying to serve a file

I've been trying to create a server on Android that servers files like MP3. My challenge is that when serving an MP3, I get the File NOT Found Exception Here's the server class below. public class Server extends NanoHTTPD { private static final…
Relm
  • 7,923
  • 18
  • 66
  • 113
1
vote
1 answer

Android JavaCV FFmpeg webstream to local static website

For my integrated test I'm working on an application that needs to provide a live stream to a locally hosted website. I've already built a working site that run's on nanohttpd. This application performs also special image processing. Therefore I use…
Thomas Devoogdt
  • 816
  • 11
  • 16
1
vote
2 answers

Why do I get "GET" method information when I post a data from IE 11.0 client?

I use NanoHTTPD as web server in my Android APP, I submit some date using the function SubmitCheckedItemsForm() in client. In web server client, I can receive "POST" method information when I lanuch the code in both FireFox and Chrome, but I receive…
HelloCW
  • 843
  • 22
  • 125
  • 310
1
vote
0 answers

UiAutomator locks the device and stop respond to adb commands

I'm currently trying to create a very simple UI dumper through UIautomator but having some really strange issues. In my current design I use nanohttpd to communicate with my apk. So my uiautomator test look like this:…
MilleB
  • 1,470
  • 2
  • 19
  • 32
1
vote
1 answer

How to retrieve the array in server side using NanoHTTPD in Android when I post a array var in client side?

In My.htm, I post a array var mytemp to server side, I hope to retrieve the array var in server side. I only get the a string D 1,D,2,Tom'Dog if I use the following code, how can I retrieve the array in server side ? Thanks! BTW, I hope to do a…
HelloCW
  • 843
  • 22
  • 125
  • 310
1
vote
2 answers

NanoHTTPD Server JSOn android

I want to make a sort of Json-server in android to make some REST calls in my app. I create this WebServer: public class WebServer extends NanoHTTPD{ Context context; public WebServer(Context context){ super(8080); this.context =…
Quarillion
  • 65
  • 2
  • 9
1
vote
1 answer

run NanoHttpd as a root

I would like to run NanoHttpd on an Android (KitKat 4.4) device and bind it to port 80. I understand that I can only bind to port 80 as a root user. My device has been rooted and I can fire up a process with superuser privileges successfully, like…
Ivo Renkema
  • 2,188
  • 1
  • 29
  • 40
1
vote
0 answers

How to create File object from InputStream which is created from AssetManager in Android?

I use NanoHTTPD as web server in an Android App, the function newFixedFileResponse need to pass a File object. I have place a index.html file in the folder assets of Android , I find I can only access the file via InputStream is =…
HelloCW
  • 843
  • 22
  • 125
  • 310
1
vote
0 answers

Play Local m3u8 files in Android using NanoHttpd

I need to play local m3u8 file which is stored on device SD card. From my Google search I came to know that I should use nanoHttpd server but not able to find and samples or examples. Please suggest me any sample codes or examples.
Prabhu M
  • 3,534
  • 8
  • 48
  • 87
1
vote
1 answer

NanoHTTPD is responding the same file to all files within the webpage

I have an Android app with a webview and I need the Nanohhtd to have a webserver in my Android app. Edited : All the files and the structure is saved in the internal storage of the application. The response method of the server is responding the…
Andressa Pinheiro
  • 1,517
  • 2
  • 18
  • 28