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

Add the ability to define filters and interceptors #199

Open
glassfishrobot opened this issue May 10, 2013 · 5 comments
Open

Add the ability to define filters and interceptors #199

glassfishrobot opened this issue May 10, 2013 · 5 comments
Labels
API (Both) Impacts the client and server API enhancement Adding a new feature or improving an existing one
Milestone

Comments

@glassfishrobot
Copy link

In a future version of the WebSocket API, I would love to see the ability to specify filters and interceptors both on the client and server side. This could be very similar to how you can specify JAX-RS 2 filters and interceptors today (e.g. for encryption, compression, etc). Perhaps this could even be done via CDI interceptors somehow.

Do let me know if anything needs to be explained further - I am happy to help.

Please note that these are purely my personal views and certainly not of Oracle's as a company.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Reported by reza_rahman

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
gdavison said:
Specific use case:

"In section 4.3 of the JSR 356 spec there is an example of using a @PathParam to map part of the path to a parameter, but as per RFC 6455 4.2.2. it should be possible to return a 404 status code without initiating a WebSocket interchange.

I can't find an obvious code path to do this as presumable onOpen is too late as a message has already been send down the connection. Is there a -RS like request filter available so we can intercept this?'

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA WEBSOCKET_SPEC-199

@glassfishrobot glassfishrobot added Priority: Major enhancement Adding a new feature or improving an existing one labels Feb 12, 2018
@glassfishrobot
Copy link
Author

@markt-asf markt-asf added API (Both) Impacts the client and server API Jakarta EE 10 and removed Priority: Major labels May 14, 2020
@markt-asf
Copy link
Contributor

Filters and interceptors are essentially what extensions were designed for but there hasn't been as much take up of those as expected. See #340 for some further discussion on that.

The specific example of returning something other than a 101 response to the upgrade request is soemthign that can be considered for Jakarta EE 10. ServerEndpointConfig.Configurator#modifyHandshake() is the obvious place to do that. Need to figure out the best way to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API (Both) Impacts the client and server API enhancement Adding a new feature or improving an existing one
Projects
None yet
Development

No branches or pull requests

2 participants