![Create your first WebSocket service](https://cdn.magzter.com/1387539988/1678770230/articles/0O9EnIuy81680536957346/CREATE-YOUR-FIRST-WEBSOCKET-SERVICE.jpg)
This tutorial covers the WebSocket protocol and how to work with it using the Go programming language. We’re going to develop a WebSocket client and a WebSocket server that can interact with each other. In the process, we are also going to learn the basics of Unix signal handling in Go and how to test a WebSocket server using the Websocat command line utility as well as JavaScript.
Go is an open source programming language and WebSocket is an open protocol. The same applies to HTML and JavaScript, as well as Linux. People make a living from open source projects, tools, technologies and ideas, so please recognise that and contribute in any way you can. Many thanks to all these people!
Gorilla sockets
To develop a small yet fully functional WebSocket server, we’re using the gorilla/websocket (https:// github.com/gorilla/websocket) module. The server implements the Echo service, which means that it automatically returns its input to the client. It also expects to get client input before sending data back.
Apart from gorilla/websocket, the golang.org/x/ net/websocket package offers another way of developing WebSocket clients and servers. However, according to its documentation, golang.org/x/net/ websocket lacks some features and it is advised that you use https://godoc.org/github.com/gorilla/ websocket, the one used here, or https://godoc.org/ nhooyr.io/websocket instead.
Denne historien er fra April 2023-utgaven av Linux Format.
Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.
Allerede abonnent ? Logg på
Denne historien er fra April 2023-utgaven av Linux Format.
Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.
Allerede abonnent? Logg på
![Create your first WebSocket service](https://reseuro.magzter.com/100x125/articles/5276/1248180/0O9EnIuy81680536957346/CREATE-YOUR-FIRST-WEBSOCKET-SERVICE.jpg)
Create your first WebSocket service
Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.
![Fantastic Mr Firefox](https://reseuro.magzter.com/100x125/articles/5276/1248180/cykPj7kU11680536436240/FANTASTIC-MR-FIREFOX.jpg)
Fantastic Mr Firefox
Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.
![Set up your terminal and email like it's 1983](https://reseuro.magzter.com/100x125/articles/5276/1248180/VAZbwRiep1680535273421/SET-UP-YOUR-TERMINAL-AND-EMAIL-LIKE-ITS-1983.jpg)
Set up your terminal and email like it's 1983
Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.
![Universal layer text effects with GIMP](https://reseuro.magzter.com/100x125/articles/5276/1248180/7K-VCwiTB1680534818555/UNIVERSAL-LAYER-TEXT-EFFECTS-WITH-GIMP.jpg)
Universal layer text effects with GIMP
Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.
![Jump to a federated social network](https://reseuro.magzter.com/100x125/articles/5276/1248180/PC1ABaHtO1680530556699/JUMP-TO-A-FEDERATED-SOCIAL-NETWORK.jpg)
Jump to a federated social network
Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.
![Free our SOFTWARE!](https://reseuro.magzter.com/100x125/articles/5276/1248180/w6YpvpcsC1680530070840/FREE-OUR-SOFTWARE.jpg)
Free our SOFTWARE!
Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!
![Master RPI.GPIO](https://reseuro.magzter.com/100x125/articles/5276/1248180/8Rutehn9H1680529335985/MASTER-RPIGPIO.jpg)
Master RPI.GPIO
Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -
![Waveshare Zero to Pi3](https://reseuro.magzter.com/100x125/articles/5276/1248180/WGSzYfBNe1680529008317/WAVESHARE-ZERO-TO-PI3.jpg)
Waveshare Zero to Pi3
Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.
![The Best OPEN SOURCE Software Ever!](https://reseuro.magzter.com/100x125/articles/5276/1248180/2jlRYTgwb1680526563817/THE-BEST-OPEN-SOURCE-SOFTWARE-EVER.jpg)
The Best OPEN SOURCE Software Ever!
In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.
![Linux-Mandrake 7](https://reseuro.magzter.com/100x125/articles/5276/1248180/bRg0D4SrQ1680524247505/LINUXMANDRAKE-7.jpg)
Linux-Mandrake 7
Simplicity and a wide range of applications make this a great distribution for all Linux users.