#1 2023-04-15 17:52:45

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

how to accept only websocket connections for an interface?

Is it possible to know if a connection is websocket upgraded when executing an interface call? (other authentication is not need in such case, it happens on websocket upgrade)
or, can I allow only websocket upgraded connections to an inteface?

Is it stored somehow in ServiceRunningContext.request?
Thank you in advance

Offline

#2 2023-04-15 19:14:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: how to accept only websocket connections for an interface?

I would do this check in a OnBeforeBody callback.
That is, abort any request outside of a WebSockets upgrade on some URIs.

Otherwise, you have the llfWebsockets flag which is available in LowLevelConnectionFlags from ServiceRunningContext.request.Call IIRC.

Offline

#3 2023-04-15 19:15:36

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: how to accept only websocket connections for an interface?

thanks a lot @ab

Offline

Board footer

Powered by FluxBB