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
4
votes
2 answers

Javax Websocket closing due to Illegal UTF-8 Sequence

I'm writing a Websocket client in Java, using javax.websocket API, and org.glassfish.tyrus as the implementation. Everything usually works, but sometimes, when I'm receiving very large strings, the connection closes with a mysterious 'Illegal UTF-8…
Ali
  • 261,656
  • 265
  • 575
  • 769
4
votes
1 answer

Access UserAgent in Websocket session?

Using the Tyrus reference implementation of Java's "JSR 356 - Java API for WebSocket", I cannot find a way to access the HTTP connection that was used for the Websocket upgrades. Thus, I cannot access the HTTP headers that the browser sent. Is there…
lathspell
  • 3,040
  • 1
  • 30
  • 49
4
votes
0 answers

Tyrus reconnect handler not reached on Android

I managed to get client reconnects working using the built-in Java 7 NIO2 client on the desktop (Windows 8.1 x64, JDK 8) with Tyrus 1.9 and prior versions as is described here: https://tyrus.java.net/documentation/1.9/user-guide.html#d0e1311. On…
Atorian
  • 777
  • 10
  • 26
4
votes
1 answer

Receiving pings with Java EE Websocket API

I'm currently working with the Tyrus reference implementation of the Java Websocket API. I've successfully created a server endpoint that receives binary messages, text messages, and pong messages, but I'm stuck trying to get it to receive ping…
11th Hour Worker
  • 337
  • 3
  • 14
4
votes
1 answer

How to deploy Tyrus (JSR 356 implementation) to a web container?

I am attempting to deploy Tyrus to a Tomcat 8 container and am failing. According to the documentation, I should be able to deploy a WAR containing my classes and supporting Tyrus classes/dependencies and all classes annotated with @ServerEndpoint…
mchandler
  • 926
  • 1
  • 12
  • 18
3
votes
2 answers

Incoming buffer size cannot be set to Tyrus client

I trying to transfer a file bigger than 4M via WebSocket. I'm using org.glassfish.tyrus:tyrus-server:1.13.1 and org.glassfish.tyrus:tyrus-container-grizzly-server:1.13.1 as dependencies. By default the incoming buffer size is about 4M (see: 8.4.…
dim
  • 992
  • 11
  • 26
3
votes
0 answers

Tyrus sometimes stuck when trying to connect

I'm using the tyrus-standalone-client-1.12.jar to maintain a connection to a Websocket server (or set of servers) I have no control over. I'm creating a ClientManager instance that I configure and then use clientManager.asyncConnectToServer(this,…
user2375667
  • 463
  • 3
  • 10
3
votes
2 answers

Tyrus websocket client on native Android app closes abnormally on receiving more than 16KB binary messages from websocket server over WSS

I'm using Tyrus websocket client (version 1.12) in a native Android app (Java), to connect to a websokcet server over WSS. I'm able to send and receive binary messages. However when I try to receive a binary message from server that is greater than…
Aditya Pasumarthi
  • 1,219
  • 2
  • 9
  • 3
3
votes
1 answer

Why do client websocket close codes not match the server code?

I have a Spring Boot Tomcat server that is handling websocket connections from clients that are using: SocketRocket Tyrus I find that the close code provided by the server is often not the close code read by the client. For SocketRocket, I close…
mattm
  • 5,851
  • 11
  • 47
  • 77
3
votes
1 answer

How many threads per websocket connection Tyrus uses?

I am trying to understand the threading model for Tyrus websocket connection. Is Tyrus using one thread per websocket connection? Is there some thread pooling mechanism involved? I tried to find a document that describe the internals of Tyrus…
kaptan
  • 3,060
  • 5
  • 34
  • 46
3
votes
0 answers

Delay when closing Tyrus WebSocket Sessions

I'm building a service with Tyrus in Standalone Mode (Grizzly Server) where I send huge amounts of binary data via WS to a client. In my setup, the service is located behind a proxy server, so all data that is send, is first buffered at the proxy…
3
votes
0 answers

Java Spring Audio chat

How can I develop web application that allow audio chat to users, using Java and Spring? I have used WebSocket within Java Web 7 ([https://tyrus.java.net/][Project Tyrus]), and it works great with text massages. But for audio chat I can't figure it…
Elbassel
  • 444
  • 7
  • 19
3
votes
2 answers

How to include a cookie in the initial WebSocket client request using Tyrus java client?

I'm using the Tyrus client package to consume, from my Java application, a websocket endpoint that requires a cookie header in the initial client request. Looking through the Tyrus client API docs and Google'ing around hasn't got me too far. Any…
Balthorium
  • 99
  • 1
  • 6
2
votes
0 answers

Tyrus Websockets: RSV bit(s) incorrectly set

I'm trying to set up a websocket server in java using tyrus, connecting to it via a website opened in firefox. I'm using localhost for the ip address. The connection is established fine, but as soon as I try to send a message accross the server…
WARdd
  • 76
  • 5
2
votes
0 answers

Websocket dependency runtime error, could not find an implementation class

I'm faced with an interesting problem. I have an intellij plugin which creates an intellij tool window which, as part of its functionality, uses a websocket. In my build.gradle, I have compile group: 'org.glassfish.tyrus.bundles', name:…