Tiny, easily embeddable HTTP server in Java.

Overview

NanoHTTPD – a tiny web server in Java

NanoHTTPD is a light-weight HTTP server designed for embedding in other applications, released under a Modified BSD licence.

It is being developed at Github and uses Apache Maven for builds & unit testing:

  • Build status: Build Status
  • Coverage Status: Coverage Status
  • Current central released version: Maven Central

Quickstart

We'll create a custom HTTP server project using Maven for build/dep system. This tutorial assumes you are using a Unix variant and a shell. First, install Maven and Java SDK if not already installed. Then run:

mvn compile
mvn exec:java -pl webserver -Dexec.mainClass="org.nanohttpd.webserver.SimpleWebServer"

You should now have a HTTP file server running on http://localhost:8080/.

Custom web app

Let's raise the bar and build a custom web application next:

mvn archetype:generate -DgroupId=com.example -DartifactId=myHellopApp -DinteractiveMode=false
cd myHellopApp

Edit pom.xml, and add this between <dependencies>:

<dependency>
	<groupId>org.nanohttpd</groupId> <!-- <groupId>com.nanohttpd</groupId> for 2.1.0 and earlier -->
	<artifactId>nanohttpd</artifactId>
	<version>2.2.0</version>
</dependency>

Edit src/main/java/com/example/App.java and replace it with:

    package com.example;
    
    import java.io.IOException;
    import java.util.Map;
    
    import fi.iki.elonen.NanoHTTPD;
    // NOTE: If you're using NanoHTTPD >= 3.0.0 the namespace is different,
    //       instead of the above import use the following:
	// import org.nanohttpd.NanoHTTPD;
    
    public class App extends NanoHTTPD {
    
        public App() throws IOException {
            super(8080);
            start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
            System.out.println("\nRunning! Point your browsers to http://localhost:8080/ \n");
        }
    
        public static void main(String[] args) {
            try {
                new App();
            } catch (IOException ioe) {
                System.err.println("Couldn't start server:\n" + ioe);
            }
        }
    
        @Override
        public Response serve(IHTTPSession session) {
            String msg = "<html><body><h1>Hello server</h1>\n";
            Map<String, String> parms = session.getParms();
            if (parms.get("username") == null) {
                msg += "<form action='?' method='get'>\n  <p>Your name: <input type='text' name='username'></p>\n" + "</form>\n";
            } else {
                msg += "<p>Hello, " + parms.get("username") + "!</p>";
            }
            return newFixedLengthResponse(msg + "</body></html>\n");
        }
    }

Compile and run the server:

mvn compile
mvn exec:java -Dexec.mainClass="com.example.App"

If it started ok, point your browser at http://localhost:8080/ and enjoy a web server that asks your name and replies with a greeting.

Nanolets

Nanolets are like servlets only that they have a extremely low profile. They offer an easy to use system for a more complex server application. This text has to be extended with an example, so for now take a look at the unit tests for the usage. https://github.com/NanoHttpd/nanohttpd/blob/master/nanolets/src/test/java/org/nanohttpd/junit/router/AppNanolets.java

Status

We are currently in the process of stabilizing NanoHTTPD from the many pull requests and feature requests that were integrated over the last few months. The next release will come soon, and there will not be any more "intended" major changes before the next release. If you want to use the bleeding edge version, you can clone it from Github, or get it from sonatype.org (see "Maven dependencies / Living on the edge" below).

Project structure

NanoHTTPD project currently consist of four parts:

  • /core – Fully functional HTTP(s) server consisting of one (1) Java file, ready to be customized/inherited for your own project.

  • /samples – Simple examples on how to customize NanoHTTPD. See HelloServer.java for a killer app that greets you enthusiastically!

  • /websocket – Websocket implementation, also in a single Java file. Depends on core.

  • /webserver – Standalone file server. Run & enjoy. A popular use seems to be serving files out off an Android device.

  • /nanolets – Standalone nano app server, giving a servlet like system to the implementor.

  • /fileupload – integration of the apache common file upload library.

Features

Core

  • Only one Java file, providing HTTP 1.1 support.
  • No fixed config files, logging, authorization etc. (Implement by yourself if you need them. Errors are passed to java.util.logging, though.)
  • Support for HTTPS (SSL).
  • Basic support for cookies.
  • Supports parameter parsing of GET and POST methods.
  • Some built-in support for HEAD, POST and DELETE requests. You can easily implement/customize any HTTP method, though.
  • Supports file upload. Uses memory for small uploads, temp files for large ones.
  • Never caches anything.
  • Does not limit bandwidth, request time or simultaneous connections by default.
  • All header names are converted to lower case so they don't vary between browsers/clients.
  • Persistent connections (Connection "keep-alive") support allowing multiple requests to be served over a single socket connection.

Websocket

  • Tested on Firefox, Chrome and IE.

Webserver

  • Default code serves files and shows (prints on console) all HTTP parameters and headers.
  • Supports both dynamic content and file serving.
  • File server supports directory listing, index.html and index.htm.
  • File server supports partial content (streaming & continue download).
  • File server supports ETags.
  • File server does the 301 redirection trick for directories without /.
  • File server serves also very long files without memory overhead.
  • Contains a built-in list of most common MIME types.
  • Runtime extension support (extensions that serve particular MIME types) - example extension that serves Markdown formatted files. Simply including an extension JAR in the webserver classpath is enough for the extension to be loaded.
  • Simple CORS support via --cors parameter
    • by default serves Access-Control-Allow-Headers: origin,accept,content-type
    • possibility to set Access-Control-Allow-Headers by setting System property: AccessControlAllowHeader
    • _example: _ -DAccessControlAllowHeader=origin,accept,content-type,Authorization
    • possible values:
      • --cors: activates CORS support, Access-Control-Allow-Origin will be set to *.
      • --cors=some_value: Access-Control-Allow-Origin will be set to some_value.

CORS argument examples

  • --cors=http://appOne.company.com
  • --cors="http://appOne.company.com, http://appTwo.company.com": note the double quotes so that the two URLs are considered part of a single argument.

Maven dependencies

NanoHTTPD is a Maven based project and deployed to central. Most development environments have means to access the central repository. The coordinates to use in Maven are:

<dependencies>
	<dependency>
		<groupId>org.nanohttpd</groupId> <!-- <groupId>com.nanohttpd</groupId> for 2.1.0 and earlier -->
		<artifactId>nanohttpd</artifactId>
		<version>CURRENT_VERSION</version>
	</dependency>
</dependencies>

(Replace CURRENT_VERSION with whatever is reported latest at http://nanohttpd.org/.)

The coordinates for your development environment should correspond to these. When looking for an older version take care because we switched groupId from com.nanohttpd to org.nanohttpd in mid 2015.

Next it depends what you are using NanoHTTPD for, there are three main usages.

Gradle dependencies

In gradle you can use NanoHTTPD the same way because gradle accesses the same central repository:

dependencies {
	runtime(
		[group: 'org.nanohttpd', name: 'nanohttpd', version: 'CURRENT_VERSION'],
	)
}

(Replace CURRENT_VERSION with whatever is reported latest at http://nanohttpd.org/.)

Just replace the name with the artifact id of the module you want to use and gradle will find it for you.

Develop your own specialized HTTP service

For a specialized HTTP (HTTPS) service you can use the module with artifactId nanohttpd.

	<dependency>
		<groupId>org.nanohttpd</groupId> <!-- <groupId>com.nanohttpd</groupId> for 2.1.0 and earlier -->
		<artifactId>nanohttpd</artifactId>
		<version>CURRENT_VERSION</version>
	</dependency>

Here you write your own subclass of org.nanohttpd.NanoHTTPD to configure and to serve the requests.

Develop a websocket based service

For a specialized websocket service you can use the module with artifactId nanohttpd-websocket.

	<dependency>
		<groupId>org.nanohttpd</groupId> <!-- <groupId>com.nanohttpd</groupId> for 2.1.0 and earlier -->
		<artifactId>nanohttpd-websocket</artifactId>
		<version>CURRENT_VERSION</version>
	</dependency>

Here you write your own subclass of org.nanohttpd.NanoWebSocketServer to configure and to serve the websocket requests. A small standard echo example is included as org.nanohttpd.samples.echo.DebugWebSocketServer. You can use it as a starting point to implement your own services.

Develop a custom HTTP file server

For a more classic approach, perhaps to just create a HTTP server serving mostly service files from your disk, you can use the module with artifactId nanohttpd-webserver.

	<dependency>
		<groupId>org.nanohttpd</groupId>
		<artifactId>nanohttpd-webserver</artifactId>
		<version>CURRENT_VERSION</version>
	</dependency>

The included class org.nanohttpd.SimpleWebServer is intended to be used as a starting point for your own implementation but it also can be used as is. Starting the class as is will start a HTTP server on port 8080 and publishing the current directory.

Living on the edge

The latest Github master version can be fetched through sonatype.org:

<dependencies>
	<dependency>
		<artifactId>nanohttpd</artifactId>
		<groupId>org.nanohttpd</groupId>
		<version>XXXXX-SNAPSHOT</version>
	</dependency>
</dependencies>
...
<repositories>
	<repository>
		<id>sonatype-snapshots</id>
		<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
	</repository>
</repositories>

generating an self signed SSL certificate

Just a hint how to generate a certificate for localhost.

keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048 -ext SAN=DNS:localhost,IP:127.0.0.1  -validity 9999

This will generate a keystore file named 'keystore.jks' with a self signed certificate for a host named localhost with the IP address 127.0.0.1 . Now you can use:

server.makeSecure(NanoHTTPD.makeSSLSocketFactory("/keystore.jks", "password".toCharArray()), null);

Before you start the server to make NanoHTTPD serve HTTPS connections, when you make sure 'keystore.jks' is in your classpath.


Thank you to everyone who has reported bugs and suggested fixes.

Comments
  • Make artifacts available on Maven Central

    Make artifacts available on Maven Central

    Since this is an embeddable server, it would be very handy to make it available on Maven Central (or somewhere - please let me know if it is on another public maven repo which I haven't been able to find)

    opened by admackin 52
  • Cannot set web root as file:///android_asset/ in Android

    Cannot set web root as file:///android_asset/ in Android

    Hi, First of all excuse me if this question is not well suited for a bug tracker, but I don't know of any nanohttpd support channel. I would like to deploy a web application on Android, stored in the assets directory. Since I use Google APIs I cannot load the html files directly from the filesystem, so I cannot simply do: myWebView.loadUrl("file:///android_asset/index.html");

    Instead I embedded nanohttpd in my application and I load it with: myWebView.loadUrl("http://localhost:8080/");

    What's the problem? The problem is that file:///android_asset/ is not an ordinary directory and I don't know any other way to access files inside it.

    Ideally I would like to set nanohttpd's web root directory to file:///android_asset/, but I don't know how to do it because it isn't a real path on the filesystem. Any idea?

    question 
    opened by darkbasic 31
  • SocketTimeoutException on websocket

    SocketTimeoutException on websocket

    version 2.3.1 and 2.3.2-SNAPSHOT

    11:28:12,450 DEBUG NanoWSD$WebSocket:23 - opened 11:28:13,655 DEBUG NanoWSD$WebSocket:59 - Received Frame WS[Text, fin, masked, [2b] bb] 11:28:13,663 DEBUG NanoWSD$WebSocket:66 - Sent Frame WS[Text, fin, unmasked, [2b] bb] 11:28:13,811 DEBUG NanoWSD$WebSocket:59 - Received Frame WS[Text, fin, masked, [2b] bb] 11:28:13,812 DEBUG NanoWSD$WebSocket:66 - Sent Frame WS[Text, fin, unmasked, [2b] bb] 11:28:13,962 DEBUG NanoWSD$WebSocket:59 - Received Frame WS[Text, fin, masked, [2b] bb] 11:28:13,962 DEBUG NanoWSD$WebSocket:66 - Sent Frame WS[Text, fin, unmasked, [2b] bb] 11:28:14,107 DEBUG NanoWSD$WebSocket:59 - Received Frame WS[Text, fin, masked, [2b] bb] 11:28:14,107 DEBUG NanoWSD$WebSocket:66 - Sent Frame WS[Text, fin, unmasked, [2b] bb] 11:28:19,116 DEBUG NanoWSD$WebSocket:53 - exception occured java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:170) at java.net.SocketInputStream.read(SocketInputStream.java:141) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) at fi.iki.elonen.NanoWSD$WebSocketFrame.read(NanoWSD.java:435) at fi.iki.elonen.NanoWSD$WebSocket.readWebsocket(NanoWSD.java:248) at fi.iki.elonen.NanoWSD$WebSocket.access$200(NanoWSD.java:65) at fi.iki.elonen.NanoWSD$WebSocket$1.send(NanoWSD.java:88) at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:957) at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192) at java.lang.Thread.run(Thread.java:745) 11:28:19,125 DEBUG NanoWSD$WebSocket:29 - Closed [Self] InternalServerError: Handler terminated without closing the connection.

    question 
    opened by publicocean0 20
  • make nanohtttpd easier to extend

    make nanohtttpd easier to extend

    as stated in #236 the base class should be cleaned-up for extention

    • all private methods to protected?
    • all inner classes to static?
    • move all object instanciations in creator methods (or a more general factory system)
    • still keep the class from growing to big ;-)

    any other ideas or objections? @LordFokas @tuxedo0801

    enhancement 
    opened by ritchieGitHub 20
  • WebSocket onOpen() error

    WebSocket onOpen() error

    Calling a send() method in a websocket's onOpen() callback causes an error on the socket. I shall come back later with more details or a fix if possible, but right now I'm in a hurry so I'm just making sure this doesn't go unchecked ;)

    bug 
    opened by LordFokas 15
  • ssl connection fail  for safari and android browser

    ssl connection fail for safari and android browser

    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 simpleServer Class to establish it.

    my CA is here

    http://www.mediafire.com/download/53f6e9uveb47kqv/ca.cer // for client to download

    http://www.mediafire.com/download/v9i58n38yb85co5/server.p12 //for server to load keystore

    CA password both are singuler

    Here is my sslServerSocket Code

    char[]kspass = KEYSTOREPASS.toCharArray();
    char[]ctpass = KEYSTOREPASS.toCharArray();
    try {
    
    
        KeyStore ks = KeyStore.getInstance("PKCS12");
        //ks.load(new FileInputStream("file:///android_asset/singuler.keystore"),kspass);
        ks.load(getResources().getAssets().open("server.p12"),kspass);
    
        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
        kmf.init(ks, ctpass);
        TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("X509");
        SSLContext sc = SSLContext.getInstance("TLS");
        sc.init(kmf.getKeyManagers(), null, null);
    
        //webServer.makeSecure(NanoHTTPD.makeSSLSocketFactory(ks, kmf.getKeyManagers()));
        webServerSSL.makeSecure(sc.getServerSocketFactory());
    
    } catch (Exception e) {
        // TODO: handle exceptionser
        Log.i("test", e.toString());
    }
    
    
    
    try {
        webServer.start(15);
        webServerSSL.start(15);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        webServer = null;
        webServerSSL=null;
        Log.i("test", e.toString());
    
    bug 
    opened by stereo720712 15
  • POST HTTP Body

    POST HTTP Body

    How can I read the full HTTP body of the send request in my public Response serve(IHTTPSession session) { implementation?


    (I've tried IOUtils.readFully(session.getInputStream(), -1, false) already but it looks like it always ends in a SocketTimeoutException.)

    enhancement 
    opened by hohl 15
  • report an important bug

    report an important bug

    I am testing nanohttpd, when I upload a png, upload successfully. My png pic is 3,204 byte, but the save file is only 3181 byte. missing byte Please fix it. this is a important bug.

    bug 
    opened by onexuan 14
  • range value from GET command not init

    range value from GET command not init

    When user send a GET command with range firstly, then user send another GET command without range field, then the second GET command will still use the same range value from the previous GET command, which is not correct.

    If use didn't send range in GET command, it should means range=0. Below patch works for me:

    diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
    index ce292a4..aba21c4 100644
    --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
    +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
    @@ -1039,6 +1039,7 @@ public abstract class NanoHTTPD {
              */
             private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, String> parms, Map<String, String> headers)
                 throws ResponseException {
    +            headers.put("range","bytes=0-");
                 try {
                     // Read the request line
                     String inLine = in.readLine();
    

    It seems I didn't have permission to push it.

    bug 
    opened by wjj1928 14
  • NanoHTTPD uri router

    NanoHTTPD uri router

    Hi guys, Is there any plan to add simple routing mechanism in NanoHTTPD. Something as server.add("/user/:id", SomeClass.class); SomeClass can have methods get(), post, put, etc. and these methods can get Map<String, String> urlParams with all other things coming from IHTTPSession.

    I can try to implement such functionality.

    opened by vnnv 13
  • project owner does not seem to maintain this project anymore

    project owner does not seem to maintain this project anymore

    after waiting to for my pull request to be included (adaptations for deployment to central) for a while i noticed that the project owner has not reacted to any request for almost a year.

    There are a lot of bug fixes and features waiting, so who is with me to create a new organisation and start a new maintained fork? I do not have the time (i have a lot of other open-source projects I work on more actively) to go into the core of this project but i am willing to help with build issues, unit-tests travis-ci and so.

    But if there are some developers that will take the core part of the job, like checking if a pull request is plausible or would break something (that's not yet in the unit test ;-) ). Than I can take the part of build structure, releasing and central deployment.

    anyone?

    opened by ritchieGitHub 13
  • Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT

    Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT

    Executing tasks: [:app:assembleDebug] in project D:\android projects\live projects\Glassboxx\wla-android\brandedApp

    Configuration on demand is an incubating feature.

    Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:compileDebugRenderscript NO-SOURCE Task :app:dataBindingMergeDependencyArtifactsDebug FAILED Task :app:dataBindingMergeGenClassesDebug FAILED Task :app:generateDebugResValues Task :app:generateDebugResources Task :app:injectCrashlyticsMappingFileIdDebug

    Task :app:processDebugGoogleServices Parsing json file: D:\android projects\live projects\Glassboxx\wla-android\brandedApp\app\google-services.json

    Task :app:mergeDebugResources FAILED Task :app:dataBindingTriggerDebug Task :app:generateDebugBuildConfig Task :app:checkDebugAarMetadata FAILED Task :app:createDebugCompatibleScreenManifests Task :app:extractDeepLinksDebug Task :app:processDebugMainManifest FAILED Task :app:mergeDebugNativeDebugMetadata NO-SOURCE Task :app:mergeDebugShaders Task :app:compileDebugShaders NO-SOURCE Task :app:generateDebugAssets UP-TO-DATE Task :app:mergeDebugAssets FAILED Task :app:processDebugJavaRes NO-SOURCE Task :app:checkDebugDuplicateClasses FAILED Task :app:desugarDebugFileDependencies FAILED Task :app:mergeDebugJniLibFolders Task :app:mergeDebugNativeLibs FAILED Task :app:validateSigningDebug Task :app:writeDebugAppMetadata Task :app:writeDebugSigningConfigVersions

    FAILURE: Build completed with 9 failures.

    1: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.

    Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Required by: project :app Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Required by: project :app

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    2: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:dataBindingMergeGenClassesDebug'.

    Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Required by: project :app Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Required by: project :app

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    3: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    4: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    5: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:processDebugMainManifest'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    6: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugAssets'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    7: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    8: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:desugarDebugFileDependencies'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    9: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd/master-SNAPSHOT/nanohttpd-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2 Could not find com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://dl.google.com/dl/android/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jcenter.bintray.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - file:/C:/Users/44370/.m2/repository/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://repo.maven.apache.org/maven2/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://jitpack.io/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-nanohttpd-project-2.3.1-gc3b149e-77.pom - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://s3.amazonaws.com/repo.commonsware.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://oss.sonatype.org/content/repositories/snapshots/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom - https://liblcp.dita.digital/com.github.edrlab.nanohttpd/nanohttpd-nanolets/android/aar/mxlQu45rdyUvveB/master-SNAPSHOT.jar - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/maven-metadata.xml - https://maven.google.com/com/github/edrlab/nanohttpd/nanohttpd-nanolets/master-SNAPSHOT/nanohttpd-nanolets-master-SNAPSHOT.pom Required by: project :app project :app > com.github.readium:r2-streamer-kotlin:develop-SNAPSHOT:2.1.0-g4d83dc8-2

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    • Get more help at https://help.gradle.org

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD FAILED in 21s 21 actionable tasks: 21 executed

    opened by Pratyush149 1
  • fix(sec): upgrade commons-fileupload:commons-fileupload to 1.3.3

    fix(sec): upgrade commons-fileupload:commons-fileupload to 1.3.3

    What happened?

    There are 1 security vulnerabilities found in commons-fileupload:commons-fileupload 1.3.1

    What did I do?

    Upgrade commons-fileupload:commons-fileupload from 1.3.1 to 1.3.3 for vulnerability fix

    What did you expect to happen?

    Ideally, no insecure libs should be used.

    The specification of the pull request

    PR Specification from OSCS

    opened by lxxawfl 0
  • How to stream a page instead of building entire strings and delivering them

    How to stream a page instead of building entire strings and delivering them

    I use JATL HTML builder to build web pages. It takes a stream and injects HTML tags into it.

    This means that to serve a web page, NanoHTTPD calls my .serve() method, and I build a string, and return the entire string for NanoHTTPD to then copy into its output stream.

    If I can instead pass NanoHTTPD's output socket directly into the HTML builder, then the user's web browser can be rendering the top part of a web page /while/ the page builder is still building the bottom part. This is tons more efficient, and it doesn't require buffering a large string in memory.

    This tweak generates the HTTP header and then passes the output stream directly to the .serve() handler:

        public final void sender(@NonNull IHTTPSession session, @NonNull Consumer<Writer> run) {
            OutputStream outputStream = session.getOutputStream();
            SimpleDateFormat gmtFrmt = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss 'GMT'", Locale.US);
            gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT"));
    
            try {
                if (status == null) {
                    throw new Error("sendResponse(): Status can't be null.");
                }
                String encoding = new ContentType(mimeType).getEncoding();
                BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outputStream, encoding), 4096);  //  4096 because that's one memory page on all available architectures
                PrintWriter pw = new PrintWriter(out, false);
                pw.append("HTTP/1.1 ").append(status.getDescription()).append(" \r\n");
                if (mimeType != null) {
                    printHeader(pw, "Content-Type", mimeType);
                }
                if (getHeader("date") == null) {
                    printHeader(pw, "Date", gmtFrmt.format(new Date()));
                }
                for (Entry<String, String> entry : header.entrySet()) {
                    printHeader(pw, entry.getKey(), entry.getValue());
                }
                for (String cookieHeader : cookieHeaders) {
                    printHeader(pw, "Set-Cookie", cookieHeader);
                }
    //            if (getHeader("connection") == null) {  // CONSIDER  remove this at the source
    //                printHeader(pw, "Connection", (keepAlive ? "keep-alive" : "close"));
    //            }
    //            if (getHeader("content-length") != null) {
    //                setUseGzip(false);
    //            }
    //            if (useGzipWhenAccepted()) {
    //                printHeader(pw, "Content-Encoding", "gzip");
    //                setChunkedTransfer(true);
    //            }
                long pending = data != null ? contentLength : 0;
                if (requestMethod != Method.HEAD && chunkedTransfer) {
                    printHeader(pw, "Transfer-Encoding", "chunked");
                } /*else if (!useGzipWhenAccepted()) {
                    pending = sendContentLengthHeaderIfNotAlreadyPresent(pw, pending);
                } */
                pw.append("\r\n");
                pw.flush();
                run.accept(pw);  //  <-- your code builds the page here
                pw.flush();
                outputStream.flush();
                outputStream.close();  //  we can't figure out safeClose(), and the user agent awaits this, so we do it here
                NanoHTTPD.safeClose(data);
            } catch (IOException ioe) {
                NanoHTTPD.LOG.log(Level.SEVERE, "Could not send response to the client", ioe);
            }
        }
    

    (The patch also contains commented code for a few features we hacked out.)

    Here's an example of the calling code inside .serve():

        @Override
        public Response serve(@NonNull IHTTPSession session) {
            Response response = newFixedLengthResponse(Status.CONFLICT, NanoHTTPD.MIME_HTML + "; charset=UTF-8", "");
    
            response.sender(session,
                    (output) -> new HTML(output).em().raw("Can't serve web pages while busy.").end() );
    
            return null;  //  this tells the default handler that we handled the page and it has nothing to do
        }
    
    

    You can see that if the HTML() result was much longer, such as a complete report, this is more efficient than serving a string.

    So anyone can throw this patch in if they want it, and the NanoHTTPD maintainers could consider productizing it and adding it to the latest release, right?

    (Another suggestion would be to advise the big web server systems, such as Django and Ruby on Rails, that they should stream, too, instead of serving entire strings!;)

    opened by Phlip 0
  • server is overly opinionated about what is a valid HTTP verb

    server is overly opinionated about what is a valid HTTP verb

    In the current implementation, any request whose method is not one of NanoHTTPD's Method enum names is automatically rejected.

    I propose that this is a mistake. HTTP defines a standard minimal set of methods... but it's not uncommon for services to use other methods from proposed standards that are not yet accepted into the core spec, and may or may not be listed in the HTTP method registry. In fact, the current definition of Method includes quite a few verbs that are in neither one, like PROPGET and SUBSCRIBE.

    Since the shape of an HTTP request is well defined, a server framework should be able to read the request first, and then let the application logic decide whether it's possible to handle a request with that method. Since NanoHTTPD doesn't include any kind of routing feature, it is already leaving it up to the application to decide whether a given endpoint URL should allow GET, PUT, PATCH, all of the above, etc.; I'm not sure what value is being added by rejecting a request with an unrecognized method before the application can see it.

    I have a specific use case where this is a problem for me: there is a web service that uses the REPORT method (which is from the now-obscure WebDAV protocol, and is listed in the method registry), and I need to be able to simulate this service when I'm testing client-side logic. NanoHTTPD would be great for my test code in every other way, but it can't handle REPORT. A short-term solution would be to add REPORT (and, preferably, everything else that's in the method registry) to the Method enum— but I feel like that is still not a great solution in the long run. I would greatly prefer for Method to be a non-enum type that provides some static known values but also allows other values to be represented, so that the usability of the library is not dependent on whether the maintainers happen to have heard of some particular rarely-used verb.

    opened by eli-darkly 0
  • multiple request headers with same name aren't preserved

    multiple request headers with same name aren't preserved

    This is similar to https://github.com/NanoHttpd/nanohttpd/issues/629, but on the request side, and a bit worse because it actually loses information that the client has sent. In other words, if the client sends the following headers—

    my-header: value1
    my-header: value2
    

    —then session.getHeaders().get("my-header") will return only "value2". But it is legal for a client to do this (as an alternative to sending comma-delimited values), so it should be possible for the server to see what was sent.

    I don't see any workaround for this in the current implementation (I mean, except to make sure the client will always send comma-delimited values instead of multiple lines, but when you're writing server code you can't necessarily control what the client will do). And I don't think I have ever seen an HTTP server framework that simply ignores multiple header lines like this; generally they provide a method for getting a list of values for any given header name.

    opened by eli-darkly 0
  • addHeader doesn't have additive behavior

    addHeader doesn't have additive behavior

    This may be more of a documentation issue, but the name addHeader and its current description ("Adds given line to the header") don't accurately describe what the method does. It adds the header if that header name was not already added; otherwise, it replaces the previously added value. The Response contains a Map<String, String> and addHeader is implemented with a simple put.

    That means that there is no way to cause the server to return multiple header lines with the same name, even though that is allowed in HTTP. For headers whose semantics allow multiple values, you can get the same effect (from the client's point of view) by sending a single value that is a comma-delimited list. But it's a bit inconvenient to have to do that, when it's so common for HTTP server APIs to support the same "for each header name there can be multiple values" model that HTTP client APIs also support.

    If you don't feel that it's desirable to support multiple values, then I would recommend deprecating addHeader, adding a setHeader that does the same thing, and clarifying in the doc comments for both of them that the response will only have the most recent value.

    opened by eli-darkly 0
Owner
NanoHttpd
Tiny, light-weight easily embeddable HTTP server in Java.
NanoHttpd
A high-level and lightweight HTTP client framework for Java. it makes sending HTTP requests in Java easier.

A high-level and lightweight HTTP client framework for Java. it makes sending HTTP requests in Java easier.

dromara 1.2k Jan 8, 2023
A Java event based WebSocket and HTTP server

Webbit - A Java event based WebSocket and HTTP server Getting it Prebuilt JARs are available from the central Maven repository or the Sonatype Maven r

null 808 Jan 3, 2023
Asynchronous Http and WebSocket Client library for Java

Async Http Client Follow @AsyncHttpClient on Twitter. The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and a

AsyncHttpClient 6k Jan 8, 2023
Feign makes writing java http clients easier

Feign makes writing java http clients easier Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal

null 8.5k Dec 30, 2022
Google HTTP Client Library for Java

Google HTTP Client Library for Java Description Written by Google, the Google HTTP Client Library for Java is a flexible, efficient, and powerful Java

Google APIs 1.3k Jan 4, 2023
⚗️ Lightweight HTTP extensions for Java 11

Methanol A lightweight library that complements java.net.http for a better HTTP experience. Overview Methanol provides useful lightweight HTTP extensi

Moataz Abdelnasser 175 Dec 17, 2022
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Jan 5, 2023
Java HTTP Request Library

Http Request A simple convenience library for using a HttpURLConnection to make requests and access the response. This library is available under the

Kevin Sawicki 3.3k Dec 30, 2022
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Jan 5, 2023
Feign makes writing java http clients easier

Feign makes writing java http clients easier Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal

null 8.5k Jan 1, 2023
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

OkHttp See the project website for documentation and APIs. HTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP

Square 43.4k Jan 5, 2023
Share the chat messages across Minecraft Servers via HTTP backend powered by Spring Boot, this is the backend part of the project.

InterconnectedChat-Backend Share the chat messages across Minecraft Servers via HTTP backend powered by Spring Boot, this is the backend part of the p

贺兰星辰 3 Oct 6, 2021
Fast_Responder is a service that lets you quickly create an Http request responder

Fast_Responder is a service that lets you quickly create an Http request responder. The transponder can receive any request path configured and determine the request parameters according to your configuration to return different results. In addition to processing requests, the transponder can also make Http requests to any request address based on the latency, request headers, and parameters you configure. In essence, fast_responder is a dynamic mock service.

null 8 Jan 26, 2022
httpx - CLI to run HTTP file

httpx: CLI for run http file httpx is a CLI to execute requests from JetBrains Http File. How to install? Mac : brew install httpx-sh/tap/httpx Other

httpx 105 Dec 15, 2022
Easy Setup Stub Server

Moco Moco is an easy setup stub framework. Latest Release 1.1.0 More details in Release Notes User Voice Let me know if you are using Moco. Join Moco

Zheng Ye 4.1k Jan 4, 2023
Allows you to duplicate items via the server kicking you. (Credits to TheTroll2001)

CloseConnection Dupe (1.12.2-1.17.1) Allows you to duplicate items via the server kicking you. (Credits to TheTroll2001) Usage Type .dupe <method> <pa

null 20 Nov 15, 2022
ssh, scp and sftp for java

sshj - SSHv2 library for Java To get started, have a look at one of the examples. Hopefully you will find the API pleasant to work with :) Getting SSH

Jeroen van Erp 2.2k Jan 4, 2023
AltiriaSmsJavaClient, the official Java client of Altiria

¡Atención! Este proyecto aún se encuentra en desarrollo. Pronto se publicará la versión final para su uso. Altiria, cliente SMS Java Altiria SMS Java

Altiria 4 Dec 5, 2022