Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

SimpleHttpServer :: Simplified implementation of the sun http server :: Simplified handlers to execute complex operations

License

NotificationsYou must be signed in to change notification settings

Ktt-Development/simplehttpserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation




✨ This library is no longer maintained, trysimplehttpserver5. ✨




 


Logo

SimpleHttpServer

Java CICodeQLDeployMaven Centralversionlicense

A simplified implementation of thesun http server for JDK11.
This library simplifies complex operations for both the server, exchange, and handlers.
DocumentationIssues

Setup

Compiled binaries can be found on Maven Central.Maven Central

For projects built locally, compiled binaries can also be found in releases.releases

Features

📋 Complicated tasks made easy

Simplified exchange methods for:

  • Parsing HTTPGET/POST withmultipart/form-data support.
  • Output stream writing with#send.
  • Sending gzip compressed responses.
  • Sending files
SimpleHttpHandlerhandler =newSimpleHttpHandler(){@Overridepublicvoidhandle(SimpleHttpExchangeexchange){MapPOST =exchange.getPostMap();MultipartFormDataform =exchange.getMultipartFormData();Recordrecord =form.getRecord("record");FileRecordfile = (FileRecord)form.getRecord("file");exchange.send(newFile("OK.png"),true);    }};

⭐ Extended Features

Out of the box support for:

  • HTTP Cookies
  • HTTP Sessions
  • Multithreaded Servers
SimpleHttpServerserver =newSimpleHttpServer(8080);server.setHttpSessionHandler(newHttpSessionHandler());HttpHandlerhandler =newHttpHandler(){@Overridepublicvoidhandle(HttpExchangeexchange){HttpSessionsession =server.getHttpSession(exchange);Stringsession_id =session.getSessionID();Map<String,String>cookies =exchange.getCookies();exchange.close();    }};

💻 Simplified Handlers

Easy to use handlers:

  • Redirect Handler
  • Predicate Handler
  • File Handler
  • Server-Sent-Events Handler
  • Temporary Handler
  • Throttled Handler
RedirectHandlerredirect =newRedirectHandler("https://github.com/");FileHandlerfileHandler =newFileHandler();fileHandler.addFile(newFile("index.html"));fileHandler.addDirectory(newFile("/site"))SSEHandlerSSE =newSSEHandler();SSE.push("Server sent events!");ThrottledHandlerthrottled =newThrottledHandler(newHttpHandler(),newServerExchangeThrottler())

Contributing

About

SimpleHttpServer :: Simplified implementation of the sun http server :: Simplified handlers to execute complex operations

Topics

Resources

License

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp