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

How to force refresh of a page by http server?

I have a small HTTP server in Java (based on NanoHTTPD) that is able to receive data from my application (currently playing track, play state and so on). It generates a nice web page with information received in notification, but is there a way for…
ssuukk
  • 8,200
  • 7
  • 35
  • 47
2
votes
0 answers

Firefox rewrites GET request

Background: I have a Java webserver class (NanoHTTPD) which my application extends by adding sessions, page templates, authentication, and dynamic content. I wanted to make the application self contained and not rely on anything but SQLite. It is…
Eric
  • 21
  • 1
2
votes
2 answers

How can I execute php scripts on Nanohttpd?

Iam new to WebServer and iam using NanoHttpd , Everything work fine and i can connect to my phone using my web browser on my Computer, my problem is that iam trying to run a Php file manager app, called 'fsmanager' , work fine on my website i can…
2
votes
1 answer

Java SE HTML POST filename issue

I'm currently writing a program using nanoHTTPD to upload files to a server. Currently I can successfully upload the file with a preassigned name. However, I would like to maintain the original name of the file being uploaded. How it uploads…
Jordan Majd
  • 63
  • 1
  • 5
2
votes
2 answers

How to get client's IP in NanoHTTPD (HTTP server)?

I'm programming a simple web browser depending on NanoHTTPD project and it's required to get number of visitors using the IP address. Are there any ways to get the client IP using NanoHTTPD?
Dot Freelancer
  • 4,083
  • 3
  • 28
  • 50
1
vote
0 answers

Android: how to run a complex website on local http server? (with nanohttpd or equivalent)

I want my Android app to execute a complex website on a local http server directly on the phone. For that, I implemented nanohttpd. With this library, I can run locally on my phone on a http server some simple html code like this: public Response…
toto_tata
  • 14,526
  • 27
  • 108
  • 198
1
vote
1 answer

Android Emulator - How to send a http post request to it?

I created an app that uses nanohttpd to set up a small http listener. To test this i need to be able to send post request to the webserver on the emulator from my host machine using postman. So that i would be able to send a post request to…
Daniel Jørgensen
  • 1,183
  • 2
  • 19
  • 42
1
vote
1 answer

nanoHTTP with local File on android

Hy, i try to build a web server for android with local index.html but i don't get it to work. All examples i can find gives many different errors. I don't even find a solution to start a web server. i try'd it with public App() throws IOException { …
huby
  • 43
  • 4
1
vote
2 answers

Apache2 Proxy Error:Error reading from remote server

Environment: Apache2 nanohttpd (web server (java)) The site itself is and has been working fine, I have added alot of entries to a database which the nanohttpd web server returns on some endpoints I have figured out that is has todo with the…
Dinh
  • 759
  • 5
  • 16
1
vote
0 answers

Setup java HTTPS server with let's encrypt public and private keys

How to set up a basic HTTPS server with let's encrypt free certificate service? So far I followed let's encrypt setup on my CentOS 7 machine and got this nice output: Congratulations! Your certificate and chain have been saved at: …
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
1
vote
1 answer

Local Web Server with NanoHTTPD

I am trying to create a local web server using NanoHTTPD on Android. I know how to use it for a single file doing something like: @Override public Response serve(IHTTPSession session) { String answer = ""; try { FileReader index =…
1
vote
0 answers

Valid https connection without browser warning to server in local network

I'm using nanoHttpd on Android to serve files inside the local network. The device's ip address is dynamic. I setup https with a certificate generated with keytool, which works fine, but results in the nasty certificate warning in Chrome. And after…
Iceman
  • 447
  • 1
  • 4
  • 9
1
vote
1 answer

Serve font/images with Nanohttpd from Android

I'm trying to host an Angular app with nanohttpd, so I put the files into a dist/ folder inside the assets folder of the android app. Now I want to serve the angular files but I keep getting this kind of errors in console (it only appears when…
JCAguilera
  • 944
  • 1
  • 13
  • 32
1
vote
0 answers

React-Native can't use jni library correctly

I'm using nanohttpd in my native java code. When I use it normally everything looks good, but when I use jni library methods it does not work. my app uses nanohttpd to make stream for mediaPlayer. native methods: public native String LH(); public …
farbod
  • 91
  • 7
1
vote
1 answer

Android webview to access the android_asset directory in http protocol

I would like to deploy a web application on Android, stored in the assets directory. Since I use Html5 games I cannot load that HTML files directly from the file protocol. myWebView.loadUrl("file:///android_asset/www/games/index.html"); because of…