Java os process 1.0-1

Java os process

License

License

Categories

Categories

Net
GroupId

GroupId

com.payneteasy
ArtifactId

ArtifactId

http-server
Last Version

Last Version

1.0-1
Release Date

Release Date

Type

Type

pom
Description

Description

Java os process 1.0-1
Java os process
Project URL

Project URL

https://github.com/evsinev/http-server
Source Code Management

Source Code Management

https://github.com/evsinev/http-server.git

Download http-server

Filename Size
http-server-1.0-1.pom 10 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.payneteasy/http-server/ -->
<dependency>
    <groupId>com.payneteasy</groupId>
    <artifactId>http-server</artifactId>
    <version>1.0-1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.payneteasy/http-server/
implementation 'com.payneteasy:http-server:1.0-1'
// https://jarcasting.com/artifacts/com.payneteasy/http-server/
implementation ("com.payneteasy:http-server:1.0-1")
'com.payneteasy:http-server:pom:1.0-1'
<dependency org="com.payneteasy" name="http-server" rev="1.0-1">
  <artifact name="http-server" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.payneteasy', module='http-server', version='1.0-1')
)
libraryDependencies += "com.payneteasy" % "http-server" % "1.0-1"
[com.payneteasy/http-server "1.0-1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • http-server-api
  • http-server-impl
  • http-server-integration-test

http-server

The simplest http server.

Features:

  • no dependecies
  • ability to run on Android
  • small footprint

How to add it into your app

Maven

<repositories>
    <repository>
        <id>pne</id>
        <name>payneteasy repo</name>
        <url>https://maven.pne.io</url>
    </repository>
</repositories>
  
<dependency>
    <groupId>com.payneteasy.http-server</groupId>
    <artifactId>http-server-impl</artifactId>
    <version>1.0-10</version>
</dependency>

Java code

IHttpRequestHandler handler = aRequest -> HttpResponseBuilder.status(HttpResponseStatusLine.OK)
        .addHeader("Server", "Test")
        .body("Hello".getBytes())
        .build();

HttpServer server = new HttpServer(
        new InetSocketAddress(8081)
        , new HttpLoggerSystemOut()
        , Executors.newCachedThreadPool()
        , handler
        , 10_000
);
Runtime.getRuntime().addShutdownHook(new Thread(server::stop));
server.acceptSocketAndWait();

Versions

Version
1.0-1