trinopoty / socket.io-server-java

Socket.IO Server Library for Java
Other
183 stars 50 forks source link

Middleware Support #19

Closed manikmagar closed 3 years ago

manikmagar commented 3 years ago

Thanks for the port. I don't think this supports adding middlewares. Is that correct or I missed it somewhere? (Duplicates https://github.com/socketio/socket.io-server-java/issues/1)

I am looking for creating a forwarding server that listens to all event. Looking at nodejs server implementations, looks like middlewares can allow that. Any thoughts or suggestions, please? TIA!

trinopoty commented 3 years ago

There is support for an AllEventListener in SocketIoSocket class. Maybe that's what you're looking for?

manikmagar commented 3 years ago

Oh, you may be right. I'll try with that. Thanks for the pointer.

manikmagar commented 3 years ago

Thanks @trinopoty, that AllEventListener was the one for handling all events. Much appreciated!

About middlewares, Is there then any alternative way of achieving this https://socket.io/docs/v4/middlewares/#sending-credentials for authentication support? TIA!

trinopoty commented 3 years ago

Seems like it was added in v4 of the library. Currently, this library is follows v3 of the socket.io js library so this feature is not present. v4 is in the works so keep a lookout for this feature and compatibility with v4 js library.