Skip to main content

It's a robust webserver (http/ws) for hosting htag apps on the web (a process by user)

Project description

htagweb

NOT READY

This "htagweb" module provides two htag's "runners":

  • WebServer : for http only exchanges
  • WebServerWS ! for http/ws exchanges (first rendering is on http)

Theses runners are a lot more complete than the defaults ones (WebHTTP & WebWS, provided nativly with htag) If you want to expose your HTag apps on the web : they are the only real/official solutions. Theses are a lot robust and IRL tested.

  • based on starlette
  • each htag app is runned in its own process, per user (real isolation!)
  • real starlette session available (in htag instance, and starlette request)
  • compatible with oauth2 authents ( authlib )
  • works with multiple uvicorn/gunicorn webworkers
  • real process managments (interactions timeout, process expirations, ...)
  • NOT READY YET parano mode (can aes encrypt all communications between client & server ... to avoid mitm'proxies)

But be aware : it's production ready (at least, for me). It may not be free of bugs or security holes: USE AT YOUR OWN RISK. Htag and this module are youngs, and not widely tested (by experts/hackers). But due to the nature of htag, and theses runners, the risk may be minimal (only DoS), stealing datas may not be possible.

The concepts are the same :

  • one user can run only one instance(process) of an htag app at one time (like in desktop mode).
  • All user's instances(process) are destroyed, after an inactivity timeout (not like in desktop mode, to preserve healthy of the webserver)
  • the "session" live as long as the server live (may not be a problem on many hosting service (where they shutdown the server after inactivities))

A "hello world" could be :

from htag import Tag

class App(Tag.div):
    def init(self):
        self+= "hello world"

from htagweb import WebServer # or WebServerWS
WebServer( App ).run()

or, with gunicorn (in a server.py file):

from htag import Tag

class App(Tag.div):
    def init(self):
        self+= "hello world"

from htagweb import WebServer # or WebServerWS
app=WebServer( App )

and run server :

gunicorn -w 4 -k uvicorn.workers.UvicornH11Worker -b localhost:8000 --preload server:app

See more in "examples" folder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

htagweb-0.0.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

htagweb-0.0.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file htagweb-0.0.1.tar.gz.

File metadata

  • Download URL: htagweb-0.0.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1040-azure

File hashes

Hashes for htagweb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5d1962bc6a50df398e4e479f20fe18797e21d63327339fe4ac6b21415bc80221
MD5 10b81b856fe24fc39ad8bee8175b6508
BLAKE2b-256 43f30eb2ad6f94995626efeda29aed2f947f636931a790a23150d28a97b08c55

See more details on using hashes here.

File details

Details for the file htagweb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: htagweb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1040-azure

File hashes

Hashes for htagweb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d9eb89e9c4d32b3b4e795ce9fb018f4fa8af1c51b356faef40e50a3a407e769
MD5 fe092a1a1129255e7b67bd2ec8f35c26
BLAKE2b-256 9103f7f1f422da5c1f890c923cfd45b13ccd7cdc43aaae023fb5b33d471c76e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page