J12t,
@J12t@social.coop avatar

Looking for a simple Python Http/2 server, for . Not an entire framework, that would be overkill and confusing. Does such a thing exist? Or does everyone expect that apps serve the web via WSGI?

orsinium,
@orsinium@fosstodon.org avatar

@J12t

Hypercorn supports HTTP/2 with h2 and asyncio with ASGI:

https://github.com/pgjones/hypercorn/

J12t,
@J12t@social.coop avatar

@orsinium Ha! This looks great. Thank you!!

meejah,
@meejah@mastodon.social avatar

@J12t Twisted Web does HTTP2 (with Hyper).

meuon,
@meuon@fosstodon.org avatar

@J12t @jackwilliambell recently pointed me towards "microdot" a small python web framework that includes a server... pretty minimal and very interesting. https://blog.miguelgrinberg.com/post/microdot-yet-another-python-web-framework

J12t,
@J12t@social.coop avatar

@meuon @jackwilliambell indeed interesting, but I’m just looking for an http 2 server, not a framework.

DopeGhoti,

@J12t
The http.server package might fit the bill.

import http.server<br></br>import socketserver<br></br>PORT = 8080<br></br><br></br>Handler = http.server.SimpleHTTPRequestHandler<br></br>with socketserver.TCPServer( ("", PORT), Handler) as httpd:<br></br>  print( "Serving on port", PORT )<br></br>  httpd.serve_forever()<br></br>
J12t,
@J12t@social.coop avatar

@DopeGhoti does it speak http 2? I could see anything about that in docs.

DopeGhoti,

@J12t the --protocol argument should allow you to set it. I'm constrained to my work environment right now so can't test to verify that you can use --protocol HTTP/2.0 as well as 1.0 and 1.1.

J12t,
@J12t@social.coop avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • InstantRegret
  • magazineikmin
  • khanakhh
  • Youngstown
  • mdbf
  • Durango
  • slotface
  • GTA5RPClips
  • ngwrru68w68
  • rosin
  • kavyap
  • osvaldo12
  • thenastyranch
  • DreamBathrooms
  • tester
  • anitta
  • Leos
  • normalnudes
  • cubers
  • ethstaker
  • tacticalgear
  • everett
  • megavids
  • provamag3
  • modclub
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines