change examples folder location

pull/39/head
Ciro 2022-10-31 09:58:46 -03:00
rodzic 215c3dd5a5
commit dc9677a347
37 zmienionych plików z 3 dodań i 54 usunięć

Wyświetl plik

@ -3,9 +3,9 @@ Fast WebSocket and Http/Https server using CFFI with C API from [uNetworking/uWe
This project aims at High Performance PyPy3 Web Development and WebSockets
> This project will adapt the full capi from uNetworking/uWebSockets but for now it's just this.
> This project will adapt the full C API from uNetworking/uWebSockets, this same C API is used by [Bun](https://bun.sh/)
### Overly simple hello world app
### Overly simple hello world app [click here](https://github.com/cirospaciari/socketify.py/tree/main/examples) for more examples
```python
from socketify import App
@ -15,6 +15,7 @@ app.listen(3000, lambda config: print("Listening on port http://localhost:%d now
app.run()
```
### pip install
```bash

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Wyświetl plik

@ -1,52 +0,0 @@
# https://github.com/Tinche/aiofiles
# https://github.com/uNetworking/uWebSockets/issues/1426
# import os.path
# def in_directory(file, directory):
# #make both absolute
# directory = os.path.join(os.path.realpath(directory), '')
# file = os.path.realpath(file)
# #return true, if the common prefix of both is equal to directory
# #e.g. /a/b/c/d.rst and directory is /a/b, the common prefix is /a/b
# return os.path.commonprefix([file, directory]) == directory
# application/x-www-form-urlencoded
# application/x-www-form-urlencoded
# multipart/form-data
# try_end
# for_each_header
# https://github.com/uNetworking/uWebSockets.js/blob/master/examples/VideoStreamer.js
from socketify import App
from datetime import datetime
from datetime import timedelta
async def home(res, req):
data = await res.get_form_urlencoded()
print(data)
res.end(f"DATA! {data}")
app = App()
app.post("/", home)
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()
# from datetime import datetime
# raw = "_ga=GA1.1.1871393672.1649875681; affclick=null; __udf_j=d31b9af0d332fec181c1a893320322c0cb33ce95d7bdbd21a4cc4ee66d6d8c23817686b4ba59dd0e015cb95e8196157c"
# jar = Cookies(None)
# jar.set("session_id", "123132", {
# "path": "/",
# "domain": "*.test.com",
# "httponly": True,
# "expires": datetime.now()
# })
# print(jar.output())
# jar = cookies.SimpleCookie(raw)
# print(jar["_gaasasd"])
# print(split_header_words(raw))
#git submodule sync