njones / socketio

A Modern SocketIO library for go
MIT License
64 stars 9 forks source link

socket-io: Update the SocketID to work with a user defined prefix #74

Open njones opened 1 year ago

njones commented 1 year ago

Currently the SocketID has a generated prefix from one source. In order to allow custom prefixes the ID should contain two parts the ID and the Prefix. This way there can't be custom generators that can generate fake-able ID's in the system. The two parts could look like something as simple as:

type ID struct { prefix, id string } 

This needs to be threaded throughout the system, and must convert to a String() for logging and debugging.