Skip to content

Fy-/fyws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fyws

Simple Trio WS server with users, chans & relatives Please note that I spent 1 hour on this, but if you're interested let me know.

Example

app.py

# -*- coding: utf-8 -*-
from .fyws import *    

fy_ws = FyWS()

def create_app(cfg={}):
	fy_ws.init_app(cfg)
	from .users import user_bp
	fy_ws.register_blueprint(user_bp)

	return fy_ws

users.py

# -*- coding: utf-8 -*-
from .fyws import FyWSBlueprint, Chan

user_bp = FyWSBlueprint()

@user_bp.command('test')
async def test(user, data):
	user.join(Chan.get('test'))
	await Chan.get('loltest).send({'message': 'welcome'})

And after that

from .app import create_app
my_app = create_app()
trio.run(my_app.run)

About

Simple Python Websocket Server with users, chans & relatives (inspired by DominoIRCd)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages