| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simplified implementation of the sun http server for JDK11.
This library simplifies complex operations for both the server, exchange, and handlers.
Documentation
•
Issues
Compiled binaries can be found on Maven Central.
For projects built locally, compiled binaries can also be found in releases.
Simplified exchange methods for:
SimpleHttpHandler handler = new SimpleHttpHandler(){
@Override
public void handle(SimpleHttpExchange exchange){
Map POST = exchange.getPostMap();
MultipartFormData form = exchange.getMultipartFormData();
Record record = form.getRecord("record");
FileRecord file = (FileRecord) form.getRecord("file");
exchange.send(new File("OK.png"), true);
}
};Out of the box support for:
SimpleHttpServer server = new SimpleHttpServer(8080);
server.setHttpSessionHandler(new HttpSessionHandler());
HttpHandler handler = new HttpHandler(){
@Override
public void handle(HttpExchange exchange){
HttpSession session = server.getHttpSession(exchange);
String session_id = session.getSessionID();
Map<String,String> cookies = exchange.getCookies();
exchange.close();
}
};Easy to use handlers:
RedirectHandler redirect = new RedirectHandler("https://github.com/");
FileHandler fileHandler = new FileHandler();
fileHandler.addFile(new File("index.html"));
fileHandler.addDirectory(new File("/site"))
SSEHandler SSE = new SSEHandler();
SSE.push("Server sent events!");
ThrottledHandler throttled = new ThrottledHandler(new HttpHandler(), new ServerExchangeThrottler())| Back | FazBrowse Home | New Git URL |