Integrating websockets server to the database
First, Drupal (PHP) makes a lousy websocket server (it’s completely engineered the other way around for it) with php 8 we are getting closer but that’s out of scope for drupal.
But Drupal services (with possibly a JWT or openID Connect endpoint) seems like the best path forwards.
(That would be a variant of option 3)