How To Install python3-websockify on Ubuntu 20.04
Introduction
In this tutorial we learn how to install python3-websockify
on Ubuntu 20.04.
What is python3-websockify
python3-websockify is:
websockify was formerly named wsproxy and was part of the noVNC project.
At the most basic level, websockify just translates WebSockets traffic to normal socket traffic. Websockify accepts the WebSockets handshake, parses it, and then begins forwarding traffic between the client and the target in both directions.
Websockify supports all versions of the WebSockets protocol (Hixie and HyBi). The older Hixie versions of the protocol only support UTF-8 text payloads. In order to transport binary data over UTF-8 an encoding must used to encapsulate the data within UTF-8.
With Hixie clients, Websockify uses base64 to encode all traffic to and from the client. This does not affect the data between websockify and the server.
With HyBi clients, websockify negotiates whether to base64 encode traffic to and from the client via the subprotocol header (Sec-WebSocket-Protocol). The valid subprotocol values are ‘binary’ and ‘base64’ and if the client sends both then the server (the Python implementation) will prefer ‘binary’. The ‘binary’ subprotocol indicates that the data will be sent raw using binary WebSocket frames. Some HyBi clients (such as the Flash fallback and older Chrome and iOS versions) do not support binary data which is why the negotiation is necessary.
This package provides the Python 3 module.
There are three methods to install python3-websockify
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install python3-websockify Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install python3-websockify
using apt-get
by running the following command:
sudo apt-get -y install python3-websockify
Install python3-websockify Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install python3-websockify
using apt
by running the following command:
sudo apt -y install python3-websockify
Install python3-websockify Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install python3-websockify
using aptitude
by running the following command:
sudo aptitude -y install python3-websockify
How To Uninstall python3-websockify on Ubuntu 20.04
To uninstall only the python3-websockify
package we can use the following command:
sudo apt-get remove python3-websockify
Uninstall python3-websockify And Its Dependencies
To uninstall python3-websockify
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove python3-websockify
Remove python3-websockify Configurations and Data
To remove python3-websockify
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge python3-websockify
Remove python3-websockify configuration, data, and all of its dependencies
We can use the following command to remove python3-websockify
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge python3-websockify
References
Summary
In this tutorial we learn how to install python3-websockify
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.