Skip to content

Instantly share code, notes, and snippets.

View Morsmalleo's full-sized avatar

Morsmalleo

View GitHub Profile
@luciopaiva
luciopaiva / _Full-socketio-client-and-server-example.md
Last active January 24, 2025 14:53
Full socket.io client and server example

Full socket.io client and server example

Last updated: 2021-02-21, tested with socket.io v3.1.1

This is the simplest implementation you will find for a client/server WebSockets architecture using socket.io.

To see a full explanation, read my answer on SO here: https://stackoverflow.com/a/24232050/778272.

If you're looking for examples using frameworks, check these links:

@refo
refo / remove-leading-slash
Created June 5, 2015 13:27
javascript - Remove leading slashes
'/example/string/'.replace(/^\/+/g, '');
// Should remove all leading slashes and return 'example/string/'