Hello Dmitry -

On Tue, Oct 18, 2016 at 6:55 PM, Dmitry Polovka <messa...@messaged.lv>
wrote:

> Hey, is there any way to reject WebSocket writes from client side? I want
> clients only to listen and not waste jetty resources if someone would spam
> the connection with messages. So basically one direction messaging, server
> to client.
>

have you tried setting policy to accept 1 byte only (I think 0 didn't work
for me)?

 public class MyServlet extends WebSocketServlet {
    @Override
    public void configure(WebSocketServletFactory factory) {
        factory.getPolicy().setMaxBinaryMessageSize(1);
        factory.getPolicy().setMaxTextMessageSize(1);
        factory.register(MyListener.class);
    }
}

Greetings from Germany
Alex
_______________________________________________
jetty-users mailing list
jetty-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to