
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ihttpy
Advanced tools
Server which runs Hyper Text Transport Protocol
Check it out at PYPI

config=Configurator Specify a configurator. Use FluentConfigurator for
type hints or Configurator for plain textloglevel=LogLevel.logging Choose a logging or console form reportingrefresh_rate=0.1 Socket connection refresh ratecache_max_size=4e9 Max cache sizepip install ihttpy
import ...
config = FluentConfigurator()
@config.on(Method.GET).at('/')
def index(req: Request, srv: Server)
return Response(200, 'OK')
config._host = '0.0.0.0'
config._port = 8000
server = Server(config, loglevel=LogLevel.CONSOLE)
with server as s:
s.run()
python3 -m unittests discover tests/
rules Is a map with regular language
name] inside braces to set named group"/[day]-[n]/[month]/[year]" : "/pictures/[year]/[month]/[day]/[n].png
query localhost:8000/27-me/09/2000 will display
a photo /pictures/2000/09/27/me.png if existshost Chose server host
localhost to run locallyport Specify port for server to listen
8000error-pages used by Errors classif you want more handling control:
path field for static file responsehandler object description as
source to choose handler pathpost name of function to handle POST requestget name of function to handle GET requestheaders for additional headers to be addedstatic file response localhost:8000/my_guest_book url
"/my_guest_book": "tmp/my_guest_book.html",
router will match this url and send file tmp/my_guest_book.html
custom GET handler for localhost:8000/posts url
"/posts": {
"handler": {
"source": "handlers/my_guest_book.py",
"get": "get_posts"
}
}
this will start loaded source handler search for url and call
get_posts function
custom POST handler for localhost:8000/post url
"/post": {
"handler": {
"source": "handlers/my_guest_book.py",
"post": "handle_post"
}
}
it will call handle_post function from source found handler and process
request in that module
Handlers should be added as modules with 1 or 2 functions (which are
configured if config.json as it was described in
here)
Its signature needs to be
def function(request: Request, server: Server) -> Response:
Here you can use Server and Request that is being processed
Request structure:
self.method - request method (GET/POST)self.target - urlself.version - HTTP versionself.headers - headers dictionaryself.body - request bodyUse this properties as you need to process the request
If you want std.out as primary output use -l console
If you want file as output use -l logging
There is a logger.py for server info logging and debug, configure
LOGGER_PATH and LOG_DEBUG_PATH in defenitions.py
FAQs
A http server with fluent interface decorators, and plain text configuration
We found that ihttpy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.