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

Android NanoHTTPD Streaming content persistent connection

I have been using NanoHTTPD in one of our apps to serve content, including Audio and Video from local SDCard to the Webview. The content range and content length headers along with the HTTP Status have been correctly configured. Now, we have a use…
Pulkit Gupta
  • 116
  • 1
  • 4
0
votes
2 answers

NIO Http file server - connection closed prematurely

I want to create an HTTP static file server using java NIO and it works fine for small files, but seems to truncate the HTTP response for larger files (672 KB out of a 3.8 MB image is returned according to my Chrome Inspector, and my browser…
Sridhar Sarnobat
  • 25,183
  • 12
  • 93
  • 106
0
votes
1 answer

Weird issues with gzip encoded responses

Ok, so I'm running my own fork of NanoHttpd (a minimalist java web server, the fork is quite complex though), and I had to implement gzip compression on top of it. It has worked fine, but it just turned out that firefox 33.0 on Linux mint 17.1 will…
Seppo420
  • 2,041
  • 2
  • 18
  • 37
0
votes
1 answer

How to do a slideshow with Chromecast

I have a folder with several images in my sdcard that I want to send to my TV using Chromecast as a slideshow. I am using nanoHTTPD to serve those images and everytime I click my 'next button' I serve the next image of my list to the server. An…
0
votes
1 answer

Receive POST Data equivalent in Java

I've got the following python code which receives POST Data and writes it into a file. def do_POST(self): content_length = self.headers['content-length'] content = self.rfile.read(int(content_length)) with open("filename.txt", 'w') as…
mr.proton
  • 993
  • 2
  • 10
  • 24
0
votes
1 answer

Android browser can't connect to local nanohttpd service

I'm creating a service as root using WakefulBroadcastReceiver approach for some test purpose (Note that I just tested with an Activity launching the server, same thing happen): MyService.java @Override public int onStartCommand(Intent intent, int…
Michael Laffargue
  • 10,116
  • 6
  • 42
  • 76
0
votes
1 answer

How to download and stream audio in Android?

I'm trying to implement a feature in an app I'm making which enables the user to listen to an online stream. What I need to do is to download the file along with playing it. I've figured out so much that I need a local HTTP server which I used…
2hamed
  • 8,719
  • 13
  • 69
  • 112
0
votes
0 answers

Client socket auto close

I using nanoHttpD to read a put request and parse a atom xml, my client will keep read a file and send the xml every 5 sec, but some how the client socket keep closing. client code clientSocket = new Socket(Setting.HOST_ATOMSERVER, 4567); try…
user3333603
  • 81
  • 1
  • 1
  • 10
0
votes
1 answer

How to recieve and display nanohttpd headers in android?

On the server side I am using following code answered by a member. I want to send the name of the file and display it on client side. public class StackOverflowMp3Server extends NanoHTTPD { public StackOverflowMp3Server() { …
SSM
  • 1
0
votes
1 answer

NanoHTTPD server on desktop

I'm trying to serve a small file on my desktop using NanoHTTPD. The server starts fine but due to some unknown reason, it is unable to serve files. The same program works fine in Android. Can anyone give me some pointers? It's being more than an…
Vinit Shandilya
  • 1,643
  • 5
  • 24
  • 44
0
votes
1 answer

Reduce unused firefox connection

I have built an embedded web server by extending NanoHTTPD (1.25). It is used for Firefox browser to show its content within the same machine. (SuSE 11) Since the Firefox needs to show changing content within a very short duration (0.2 sec…
Stanley Stein
  • 397
  • 1
  • 3
  • 17
0
votes
3 answers

Android web server nanohttpd - cannot connect from browser on same device

I have attempted to set up a simple web server on Android using the nanohttpd demo application without modification. The Android devices that I am using are running Android 4.0.3. I am able to access the web server from other devices, but I am…
KenSt
  • 19
  • 4
0
votes
2 answers

How to use NanoHTTPD to show log file

I have written a java desktop application that accepts http requests using embedded NanoHTTPD web server https://github.com/NanoHttpd/nanohttpd, after receiving http request my desktop application makes some activity and keeps writing to log text…
Amr Lotfy
  • 2,937
  • 5
  • 36
  • 56
0
votes
1 answer

java android nanohttpd - proper way to copy file uploaded from the temporarily storage to internal storage

A related question was asked here move file uploaded from nanohttpd's Temporary directory to SD card the reference questioner asks for copying an nanohttpd uploaded file to external sd card. However, if we wish to have a copy of the uploaded file…
Bigs
  • 616
  • 2
  • 11
  • 17
0
votes
0 answers

Nanohttpd - Bad Gateway caused by Chrome's Data Compression Proxy

I'm running Nanohttpd inside my Android App. All works fine. The pages get served to my desktop browser. But if I access the url using 127.0.0.1.. or 192.168.1.x.. from my chrome browser on the same android device, I get bad-gateway error. The issue…
Makubex
  • 1,054
  • 1
  • 9
  • 16