How To Install websockify on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 527 words
Introduction
In this tutorial we learn how to install websockify
on Ubuntu.
What is websockify
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.
There are three methods to install websockify
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install 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 websockify
using apt-get
by running the following command:
sudo apt-get -y install websockify
Install websockify Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install websockify
using apt
by running the following command:
sudo apt -y install websockify
Install 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 websockify
using aptitude
by running the following command:
sudo aptitude -y install websockify
How To Uninstall websockify on Ubuntu
To uninstall only the websockify
package we can use the following command:
sudo apt-get remove websockify
Uninstall websockify And Its Dependencies
To uninstall websockify
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove websockify
Remove websockify Configurations and Data
To remove websockify
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge websockify
Remove websockify configuration, data, and all of its dependencies
We can use the following command to remove websockify
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge websockify
Dependencies
websockify have the following dependencies:
References
Summary
In this tutorial we learn how to install websockify
package on Ubuntu using different package management tools: apt, apt-get and aptitude.