njones / socketio

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

Add a socketio.WithPath to change the SIO path #72

Closed njones closed 1 year ago

njones commented 1 year ago

The engineio.WithPath option would change the internal EngineIO path, but left the internal SocketIO path untouched which caused issues with the service because the SocketIO and EngineIO internal paths didn't match.

This commit adds a socketio.WithPath option to change SocketIO paths (and the underlining EngineIO path).

This commit also abstracts the EngineIO WithPath option to guarantee that the code will compile even if the option is removed when building a specific version of the library. In this case it's not really important, but this is to showcase how it will work for new and refactored options.

Tests around adding the socketio.WithPath have been added separately outside of the integration tests, because they are testing a specific server configuration rather than a SocketIO implementation.

[fixes #70]