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

server: make it possible to enable ws/http only #939

Merged
merged 4 commits into from
Nov 18, 2022

Conversation

niklasad1
Copy link
Member

No description provided.

@niklasad1 niklasad1 requested a review from a team as a code owner November 17, 2022 12:20
server/src/server.rs Outdated Show resolved Hide resolved
/// except if you have enabled middleware which are processed before this check occurs.
///
/// Default: both http and ws are enabled.
pub fn ws_only(mut self) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lexnv this is a bit opinionated but I would like to have it for consistency.

Copy link
Member Author

@niklasad1 niklasad1 Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would disable all JSON-RPC HTTP requests and just reply 403 on all HTTP requests (including middleware as well), works exactly as the ws-server in v0.15

server/src/server.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

server/src/server.rs Outdated Show resolved Hide resolved
Co-authored-by: Alexandru Vasile <[email protected]>
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@niklasad1 niklasad1 merged commit 0a22c00 into master Nov 18, 2022
@niklasad1 niklasad1 deleted the na-server-enable-ws-http-only branch November 18, 2022 12:10
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

Successfully merging this pull request may close these issues.

3 participants