Skip to content

josephlim94/rapa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rapa

Remote Asynchronous Peripheral Access

The idea of this project is to expose attached peripherals such as mouse, keyboard, speaker or mass storage to web applications.

Making the computer into a webserver

Virtual environment created using Pipenv

pipenv install
pipenv shell
pipenv run

Django

django-admin startproject rapa_server .
python manage.py startapp speaker
python migrate

add speaker app into settings.py

python manage.py runserver

Channels

  • Add channels app into settings.py
  • Create routing.py with ProtocolTypeRouter in rapa_server
  • HTTP protocol routing is automatically added Websocket
  • Create routing.py in speaker
  • Create consumer.py in speaker
  • python manage.py runserver

Daphne

Authentication

N/A

Speaker

git submodule init
git submodule update

python-opus

git submodule add https://github.com/josephlim94/python-opus.git
cd python-opus
python setup.py develop
  • It uses libopus shared library, on ubuntu you install it with some sudo apt-get, but on windows it gets a bit tricky.
  • download binary from opus official website
  • either copy dlls to current directory or C:\Windows\System32 and C:\Windows\SysWOW64
  • copy libgcc_s_sjlj-1.dll, libopus-0.dll and libwinpthread-1.dll together to the location, else python will fail to load the dll.
  • reference: https://github.com/meew0/discordrb/wiki/Installing-libopus