Questions tagged [tyrus]

Tyrus is a reference implementation of JSR-356: WebSocket API for Java

Tyrus is the open source JSR 356 - Java API for WebSocket reference implementation for easy development of WebSocket applications. WebSocket protocol defined by IETF provides bi-directional communication between the server and the remote host. The pros are mainly the ability to communicate both ways, low latency and small communication overhead. Therefore Tyrus and WebSocket in general are suitable for web applications that require sending a huge volume of relatively small messages like online games or market ticker broadcasting.

The governance policy is the same as the one used in the GlassFish project. We also use the same two licenses - CDDL 1.1 and GPL 2 with CPE - so, you can pick which one suites your needs better.

120 questions
20
votes
2 answers

Java EE 7: How-to inject an EJB into a WebSocket ServerEndpoint?

To sum up my failing project: My @ServerEndpoint class is packaged in a WAR together with the beans.xml file. My WAR in turn is packaged in a EAR and this EAR file is what gets deployed to a GlassFish 4 server that internally use Tyrus. Should it be…
Martin Andersson
  • 18,072
  • 9
  • 87
  • 115
14
votes
1 answer

Tyrus WebSockets (Java) - how to set client local ip address

Is there a way to specify the local ip-address and port when using WebSockets (Tyrus)? I'm looking for the same thing you can do with the full 4 parameters constructor of Socket EDIT: I have found that the low level Grizzly TCPNIOTransport does have…
Yasei No Umi
  • 1,574
  • 9
  • 23
10
votes
4 answers

minimal java8 nio secure websocket client (wss)

I've spent quite some time to find simple java websocket client that could work with wss and wont be a mess... I've tried https://github.com/TooTallNate/Java-WebSocket added dependency as he descirbes, copied the SSLClientExample.java to test it…
vach
  • 10,571
  • 12
  • 68
  • 106
9
votes
1 answer

Tyrus websocket client @OnMessage never called - Storj Open source project

I am working on an open source project, Storj. I am writing a Java client which connects to a Node.js websocket backend. The client uses Tyrus. The communication should go as follows: Connect Client sends auth token (text). Server sends a file back…
ThePerson
  • 3,048
  • 8
  • 43
  • 69
8
votes
3 answers

Connecting to a secured websocket

I'm trying to connect to a secured websocket using Jetty (or any other library). The issue is I get a "No trusted certificate found" error. I'm using a self-signed certificate generated with keytool. What could be done? import java.net.URI; import…
caub
  • 2,709
  • 2
  • 28
  • 31
8
votes
1 answer

Howto add request header to Tyrus annotation based client

I'm trying to access a websocket server endpoint using a tyrus standalone client (tyrus-standalone-client-1.9) with an annotation based client endpoint. I was mainly following this example. That is, my client endpoint currently looks like…
dpr
  • 10,591
  • 3
  • 41
  • 71
7
votes
2 answers

What are the usecases of encoder list or decoder list in the WebSocket EndPoints annotation?

I am learning tyrus WebSocket implementation. But I don't understand why and when do we need more then one encoders or decoders in the websocket endpoints. For example: @ServerEndpoint(value = "/subscribe", decoders = {…
7
votes
3 answers

Websocket SSL handshake failure

I have spring-boot Tomcat server for secure websocket connections. The server accepts Android 4.4, iOS, Firefox, and Chrome clients without failure with an authority-signed certificate. Android 5.0, however, fails the SSL handshake. Caused by:…
mattm
  • 5,851
  • 11
  • 47
  • 77
7
votes
1 answer

Tyrus - simple java application - Could not find an implementation class

I am developing simple application to help me in learning WebSocket and Tyrus concepts in Java. Here is my server-side (server endpoint) and my pom.xml and my client side and pom.xml: SERVER SIDE @ServerEndpoint(value="/websocket/{client-id}") …
Sysrq147
  • 1,359
  • 4
  • 27
  • 49
6
votes
1 answer

Is it possible to send synchronous messages via Spring WebSocket?

I have a Spring application and it sends messages to another server asynchronously via Spring WebSocket . But for a specific case I need to send a message synchronously, I should continue the process with incoming response from the server. I don’t…
azizunsal
  • 2,074
  • 1
  • 25
  • 33
6
votes
1 answer

Combine Jersey with Tyrus

I have a Jersey JAX-RS application which runs on a Grizzly instance: public class Application { public static final String BASE_URI = "http://127.0.0.1:8080/rest"; public static void main(String[] args) throws IOException { …
Giovanni Lovato
  • 2,183
  • 2
  • 29
  • 53
5
votes
1 answer

Getting Response code was not 101: 400 in Java Websocket API client

I have the following WebSocket client code in Java. final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build(); ClientManager client = ClientManager.createClient(); client.connectToServer(new Endpoint()…
alayor
  • 4,537
  • 6
  • 27
  • 47
5
votes
1 answer

javax.websocket.DeploymentException: org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer

I am trying to create a websocket using the tyrus project. I am getting this below error: java.lang.RuntimeException: javax.websocket.DeploymentException: org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer at…
Prakash
  • 145
  • 1
  • 13
5
votes
2 answers

Lambda Does Not Work In Websocket Session

I just encountered a peculiar little problem: javax.websocket.Session session = //... // this works newSession.addMessageHandler(new MessageHandler.Whole() { @Override public void onMessage(String message) { …
Stefan S.
  • 3,950
  • 5
  • 25
  • 77
4
votes
1 answer

Is every method of ServerEndpoint executed by different thread?

I use GF 4 as JavaEE server. This is how I understand servlet processing: There is a pool of threads and when request comes one thread from this pool is taken to process the request. After that the thread is put back to pool. Based on the…
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
1
2 3 4 5 6 7 8