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

Installation of EventBusBridgeHook missing within SockJSHandlerImpl #71

Closed
leolux opened this issue Mar 20, 2015 · 6 comments
Closed

Installation of EventBusBridgeHook missing within SockJSHandlerImpl #71

leolux opened this issue Mar 20, 2015 · 6 comments

Comments

@leolux
Copy link
Contributor

leolux commented Mar 20, 2015

At SockJSHandlerImpl line 92 the EventBusBridgeHook does not get installed into the EventBusBridgeImpl, so the hook within SockJSHandlerImpl is useless.
Solution: Either call the method EventBusBrodgeImpl.setHook(this.hook) or create another constructor for the EventBusBridgeImpl and pass it to the constructor when creating the instance.

@purplefox
Copy link
Contributor

I was thinking of removing the eventbusbridgehook. Can you explain your use case and why it is useful to you?

@leolux
Copy link
Contributor Author

leolux commented Mar 20, 2015

I am still within the design phase of my project, but here are some ideas I thought could be implemented by a hook:
a) Check the country of the client and reject them based on a ip->country mapping service
b) Prevent too many requests of a client within a time-frame by counting requests by sessionId (apexSession?)
c) Collect some statistics about the client browser agent

@purplefox
Copy link
Contributor

I think all of those should be doable using standard Apex handlers?

@leolux
Copy link
Contributor Author

leolux commented Mar 20, 2015

Yes, you are right. The RoutingContext has everything inside which is need for implementing that. Today I discovered "routingContext.next()" in the apex docs. It seems that apex handles can be chained this way? Anyway, I do agree removing the hook.

@purplefox
Copy link
Contributor

OK, let me know how it goes :)

@leolux leolux closed this as completed Mar 20, 2015
@leolux
Copy link
Contributor Author

leolux commented May 9, 2015

Well, I can't use standard Apex handlers to count incoming websocket frames. The standard handlers will not be invoked for websocket communication happening after the protocol upgrade.

What I need is some interceptor that gets invoked on every incoming frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants