Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit WebSocketService/WebSocketServer to specific path #614

Closed
mincequi opened this issue Aug 29, 2024 · 1 comment
Closed

Limit WebSocketService/WebSocketServer to specific path #614

mincequi opened this issue Aug 29, 2024 · 1 comment

Comments

@mincequi
Copy link

Hi there,
i have a question regarding the WebSocket implementation. How could i limit the path for clients to only accept websocket from a specific path (e.g. /ws)?

Thanks in advance :)

@House-Men
Copy link
Contributor

onopen 回调第二个参数HttpRequestPtr可以获取到请求协议升级建立连接的附加数据,第一个参数WebSocketChannelPtr可以直接close,利用这2个参数你就可以获取 Path 不合法就close

@ithewei ithewei closed this as completed Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants