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
0 answers

Running embedded web server in Android in offline/airplane mode

i am running NanoHTTPD in my android application. i am serving some contents using this server. I am also trying to view the contents in a web view (again in my application ). i use the below code to get the ip address using the WifiManager as…
saurav
  • 5,388
  • 10
  • 56
  • 101
1
vote
1 answer

What are the embedded web server libraries that I can use for Windows RT app?

For android and iOS, I can use nanohttpd and cocoahttpserver respectively but I cannot seem to find one for WinRT.
Marc Tan
  • 118
  • 1
  • 5
1
vote
0 answers

Nanohttpd-Webserver is not stoppable after Activity-Resume

I have an activity with included webserver-class (simplified): public class MyActivity extends AppCompatActivity { SimpleWebServer webServer = new SimpleWebServer(8088); @Override protected void onCreate(Bundle savedInstanceState) { …
Cologne_Muc
  • 653
  • 6
  • 19
1
vote
2 answers

NanoHTTPD unable to process POST parameters

I have downloaded newest NanoHTTPD from link: https://raw.githubusercontent.com/NanoHttpd/nanohttpd/master/core/src/main/java/fi/iki/elonen/NanoHTTPD.java When processing very basic POST example, calling session.getParms() returns empty map. My code…
lio op
  • 11
  • 1
  • 3
1
vote
5 answers

Serve images on local server using NanoHttpd

I need to create a local server which would be able to serve local files of device. I have found this library and it seems like it able to satisfy my needs. I have tried sample inside this project and it works fine! But it posts .html page and I…
AnZ
  • 1,040
  • 24
  • 54
1
vote
1 answer

Is it possible to maintain multiple clients in NanoHttpd?

I am trying to build a simple server/client application where the NanoHttpd server communicates with the client using WebSockets. The server replies back with the same text that the client sent. Is it possible to broacast messages to all the clients…
1
vote
1 answer

Retrieve file from POST request with NanoHttpd

I am trying to use the NanoHttpd library to upload files to my Android server by using a POST request from a form. I do receive the POST request on the server side. My question is how to retrieve the file from the POST request so I can save it…
zxzak
  • 8,985
  • 4
  • 27
  • 25
1
vote
1 answer

How to stream and download a media from local storage using Android's VideoView?

I have to stream and download video files from a server and show it in VideoView, well thanks to google, VV doesn't support my requirement naturally so this is what I have done: 1-create a HTTP proxy using NanoHTTPD and start downloading a file from…
1
vote
1 answer

Getting connection reset exception when streaming large videos while using WebView and NanoHTTPD

In my application i have zipped web content. Web content has embedded video in it. I show the wen content through Android web view. I serve my content through NanoHTTPD Server. I am on Android 4.2.2 and NanoHTTPD's latest version My server supports…
saurav
  • 5,388
  • 10
  • 56
  • 101
1
vote
0 answers

nanoHTTPD - How to run as a single background thread in Android?

My application is to use nanoHTTPD as an alternative to pressing buttons and keying in text on an Android UI for automation and regression test I currently have a main UI thread and a customized nanoHTTPD running in a different thread. Consider…
1
vote
1 answer

Creating a login portal via NanoHTTPD. Help maintaining session

I am creating a simple Java website and using NanoHTTPD to allow easy control between the web server and the game server. I would like to create a login portal so clients are able to view their game server status and manage this. I have run into a…
1
vote
1 answer

How do I access the file I've uploaded to NanoHTTPD?

I've put a file on a NanoHTTPD server like this: private class WebServer extends NanoHTTPD { public WebServer() { super("hostname", 8080); } @Override public Response serve(String uri, Method method, …
Randall Stephens
  • 1,037
  • 1
  • 10
  • 16
1
vote
2 answers

How to set a timeout in NanoHttpd Server

In my app, I create a local NanoHttpd server giving it the path of video file to serve. then, start another app to play from the stream.Now, since I don't want that server to run forever. Is there any way I can know that other app has stopped…
Prince
  • 99
  • 1
  • 11
1
vote
3 answers

File Directory Navigation with Android Nanohttpd lightweight server

With the code below, i was able to create a mobile server on android phone with the Nanohttpd lightweight server. The code basically loop through the root directory of the host android device and list both files and folders as links. What i want to…
Belvi Nosakhare
  • 3,107
  • 5
  • 32
  • 65
1
vote
1 answer

NanoHttpd save uploaded files

I have looked at many threads, but I can't find an answer to my question... So I could start the webserver on my device, and when I try to upload a file the browser says "upload successfully", but I couldn't find the file on my device and I don't…