
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
server-thread
Advanced tools
Launch a WSGI or ASGI Application in a background thread with werkzeug or uvicorn.
This application was created for localtileserver
and provides the basis for how it can launch an image tile server as a
background thread for visualizing data in Jupyter notebooks.
While this may not be a widely applicable library, it is useful for a few Python packages I have created that require a background service.
Use the ServerThread with any WSGI or ASGI Application.
Start by creating a application (this can be a flask app or a simple app like below):
# Create some WSGI Application
from werkzeug import Request, Response
@Request.application
def app(request):
return Response("howdy", 200)
Then launch the app with the ServerThread class:
import requests
from server_thread import ServerThread
# Launch app in a background thread
server = ServerThread(app)
# Perform requests against the server without blocking
requests.get(f"http://{server.host}:{server.port}/").raise_for_status()
Get started with server-thread to create applications that require a
WSGIApplication in the background.
condaConda makes managing server-thread's dependencies across platforms quite
easy and this is the recommended method to install:
conda install -c conda-forge server-thread
pipIf you prefer pip, then you can install from PyPI: https://pypi.org/project/server-thread/
pip install server-thread
Please share your thoughts and questions on the Discussions board. If you would like to report any bugs or make feature requests, please open an issue.
If filing a bug report, please share a scooby Report:
import server_thread
print(server_thread.Report())
Minimal examples for using server-thread with common micro-frameworks.
import requests
from fastapi import FastAPI
from server_thread import ServerThread
app = FastAPI()
@app.get("/")
def root():
return {"message": "Howdy!"}
server = ServerThread(app)
requests.get(f"http://{server.host}:{server.port}/").json()
import requests
from flask import Flask
from server_thread import ServerThread
app = Flask("testapp")
@app.route("/")
def howdy():
return {"message": "Howdy!"}
server = ServerThread(app)
requests.get(f"http://{server.host}:{server.port}/").json()
FAQs
Launch a WSGI or ASGI Application in a background thread with werkzeug or uvicorn.
We found that server-thread 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.