How To Install websockify-common on Ubuntu 18.04

In this tutorial we learn how to install websockify-common on Ubuntu 18.04. websockify-common is WebSockets support for any application/server - shared files

Introduction

In this tutorial we learn how to install websockify-common on Ubuntu 18.04.

What is websockify-common

websockify-common 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 common files for Python 2 and 3 modules.

There are three methods to install websockify-common on Ubuntu 18.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 websockify-common 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-common using apt-get by running the following command:

sudo apt-get -y install websockify-common

Install websockify-common Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install websockify-common using apt by running the following command:

sudo apt -y install websockify-common

Install websockify-common 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-common using aptitude by running the following command:

sudo aptitude -y install websockify-common

How To Uninstall websockify-common on Ubuntu 18.04

To uninstall only the websockify-common package we can use the following command:

sudo apt-get remove websockify-common

Uninstall websockify-common And Its Dependencies

To uninstall websockify-common and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove websockify-common

Remove websockify-common Configurations and Data

To remove websockify-common configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge websockify-common

Remove websockify-common configuration, data, and all of its dependencies

We can use the following command to remove websockify-common configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge websockify-common

References

Summary

In this tutorial we learn how to install websockify-common package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.