Package: saltyrtc.server
This is a SaltyRTC server implementation for Python 3.5+ usingasyncio.NoteOn machines where Python 3 is not the default Python runtime, you should
usepip3instead ofpip.Prerequisitessudoapt-getinstallpython3python3-pipWe recommend usingvenvto create an isolated Python environment:pyvenvvenvYou can switch into the created virtual environmentvenvby running
this command:sourcevenv/bin/activateWhile the virtual environment is active, all packages installed usingpipwill be installed into this environment.To deactivate the virtual environment, just run:deactivateIf you want easier handling of your virtualenvs, you might also want to
take a look atvirtualenvwrapper.InstallationIf you are using a virtual environment, activate it first.Install the module by running:pipinstallsaltyrtc.serverThe dependencylibnaclwill be installed automatically. However, you
may need to installlibsodiumforlibnaclto work.Command Line UsageThe scriptsaltyrtc-serverwill be automatically installed and
provides a command line interface for the server.Run the following command to see detailed usage information:saltyrtc-server--helpAll command line options are also available as environment variables by
prefixing them withSALTYRTC_SERVER_and the upper case command name,
followed by the option name in upper case. For example:SALTYRTC_SERVER_SERVE_PORT=8765.Quick StartGenerate a newprivate permanent key:saltyrtc-servergenerate/path/to/permanent-keyRun the following command to start the server on any address with port8765:saltyrtc-serverserve\-p8765\-tc/path/to/x509-certificate\-tk/path/to/key\-k/path/to/permanent-keyAlternatively, provide the options via environment variables:exportSALTYRTC_SERVER_SERVE_PORT=8765\SALTYRTC_SERVER_SERVE_TLSCERT=/path/to/x509-certificate\SALTYRTC_SERVER_SERVE_TLSKEY=/path/to/key\SALTYRTC_SERVER_SERVE_KEY=/path/to/permanent-keysaltyrtc-serverserveDockerYou can also use ourofficial Docker imagesto run the server:dockerrun\-v/path/to/cert-and-keys:/var/saltyrtc\-p8765:8765-itsaltyrtc/saltyrtc-server-python:<tag>serve\-p8765\-tc/var/saltyrtc/x509-certificate\-tk/var/saltyrtc/key\-k/var/saltyrtc/permanent-keyThe above command maps port8765of the server within the container to port8765on the host machine.Of course it is also possible to use environment variables to provide the
options, as explained in the previous section.ContributingIf you want to contribute to this project, you should install the
optionaldevrequirements of the project in an editable environment:gitclonehttps://github.com/saltyrtc/saltyrtc-server-python.gitcdsaltyrtc-server-pythonpipinstall-e.[dev]Before creating a pull request, it is recommended to run the following
commands to check for code style violations (flake8), optimise
imports (isort), do a static type analysis and run the project’s tests:flake8.isort-rc.MYPYPATH=${PWD}/stubsmypysaltyrtcexamplespy.testReporting Security IssuesPlease report security issues directly to one or both of the following
contacts:Danilo BargenEmail:mail@dbrgn.chThreema: EBEP4UCAGPG:EA456E8BAF0109429583EED83578F667F2F3A5FALennart GrahlEmail:lennart.grahl@gmail.comThreema: MSFVEW6CGPG:3FDB14868A2B36D638F3C495F98FBED10482ABA6Changelog5.0.1(2019-09-09)Fix an exception when disconnected by another client5.0.0(2019-08-29)Bump the Python version requirement to 3.6.1Upgrade dependenciesFix a race condition that leads to path duplication4.2.0(2019-04-25)Internal refactoring of task and job handling4.1.1(2019-04-09)Fix accidental cancellation of the task loop4.1.0(2019-04-04)Allow the use of environment variables as CLI parameter substitutionInstead ofsaltyrtc-serverserve--tlskey=fooyou can now writeSALTYRTC_SERVER_TLSKEY=foosaltyrtc-serverserveFix import order in pyi files4.0.1(2019-01-24)Bump the Python version requirement to 3.5.3Remove workarounds for Python 3.5.24.0.0(2018-01-24)Important:Make sure you’re using Python >= 3.5.3 before upgrading.Drop Python 3.4 support (major)Deprecate the CLI options-sc,–sslcertand-sk,–sslkey. Use-tc,–tlscertand-tk,–tlskeyinstead.Add type hintsFix discard string messagesFix validate received client ID types correctlyFix validate received sub-protocols correctlyFix a race condition during the handshake when one client drops anotherCleanup of the code base3.1.2(2019-01-08)Fix imports for earlier Python 3.5 versions3.1.1(2019-01-08)Disable deprecation warning in py.test for now (see#90)3.1.0(2019-01-07)Event callback arguments now always need to provide adataargument3.0.1(2019-01-02)Fix forward thetimeoutclose code as anintto event callbacks3.0.0(2018-12-18)Use thetimeoutclose code (3008) when a client does not respond to apingmessage (major)Add support for Python 3.7Various task queue improvements resulting in more robust client handlingFix to not send a ‘disconnected’ message when a responder has been dropped
via ‘drop-responder’Fix to prevent the initiator from relaying messages to a responder client
which is in the process of being droppedFix to not accept new incoming connections when closing the server2.0.1(2018-08-20)Fix to prevent creating two path instances with the same path stringVarious improvements to logging messages2.0.0(2018-07-16)Important:Make sure you’re using Python >= 3.4.4 and that your clients
support thedisconnectedmessage before upgrading.Add support for thedisconnectedmessage (major)Fix potential invalid order of messages when dispatching asend-errorFix theidfield’s value in thesend-errormessageFix a few potential race conditions1.0.2(2017-11-15)Fix do not accept unencrypted ‘client-auth’ messages from the initiator1.0.1(2017-07-25)Fix to handle newlibnaclexceptions1.0.0(2017-03-24)Add server implementation of theSaltyRTC 1.0 ProtocolInitial publication on PyPI