527 questions
2
votes
0
answers
102
views
Java web-socket ssl certificate error while cert is valid
Hello I've been facing a weird problem the past few days.
I send out a demo of my app to a few people. however for around 75% of the people the demo didn't work, while for the other 25% it works great....
0
votes
0
answers
28
views
Spring WebSocket STOMP: convertAndSendToUser() not delivering private messages
I'm implementing private messaging with Spring WebSocket STOMP, but messages sent via convertAndSendToUser() are not being delivered, while broadcast messages work fine. The client subscribes to /user/...
0
votes
0
answers
84
views
Spring API Gateway configuration for reactive and non-reactive web sockets
I'm working on a WebSocket proxy microservice in Java, built using the org.java_websocket.* library. It connects to a remote server that streams VNC data. The goal is to allow clients—like noVNC—to ...
0
votes
0
answers
27
views
Spring WebSocket with SockJS not publishing messages to /topic destination
I’m trying to implement WebSocket support in my Spring-based backend using STOMP over SockJS. The WebSocket connection is established successfully, but messages published from the backend to /queue/...
0
votes
1
answer
151
views
Quarkus WebSockets Next Intercepting HTTP GET Requests when using the @WebSocket annotation
After moving from quarkus-websocket to quarkus-websockets-next, any HTTP GET to a @WebSocket path now errors with
"Connection" header must be "Upgrade"
This is because the new ...
0
votes
0
answers
35
views
Websocket over StompJS not able to send message to host, running Springboot
I have an Angular fontend application with a Spring Boot backend that uses websockets over Stomp. The app can successfully send websocket messages from the host to the browser. I need to now send ...
0
votes
1
answer
242
views
Cannot connect to Jetty WebSocket v11
I am trying to implement server, as java plain application, where clients could connect to a web socket.
The goal is to connect client to a websocket via this url: ws://localhost:4550/api/myWebSocket
,...
2
votes
0
answers
43
views
Websocket always closed using Tomcat 10.1
I'm working on a Servlet application using WebSocket with a Tomcat 10.1 server. My goal is to create a one-player (host) game via a WebSocket and allow other players to join this game in real time ...
1
vote
1
answer
133
views
Java 21 websocket message not received
Why this code does not receive any message:
public class MainClass {
public static void main(String[] args) throws Exception {
CountDownLatch latch = new CountDownLatch(1);
try (...
0
votes
0
answers
53
views
Difficulty converting python web socket code to java
I'm trying to convert some python web socket code to Java (code that talks to a consumer device:)
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
...
0
votes
1
answer
65
views
Set data from WebSocket Server to JFrame components
I have WebSocket server:
@ServerEndpoint(value = "/demoApp")
public class MyWebSocketServer {
@OnMessage
public String onMessage (String message, Session session) throws IOException {...
2
votes
1
answer
304
views
Can't establish connection between STOMPjs and Java Websocket using STOMP protocol
I followed this Spring Boot tutorial on Websockets implementing STOMP protocol which works perfectly on its own. I wanted to connect it to a frontend app which uses Expo so I am using STOMPjs
After ...
1
vote
0
answers
22
views
Websocket disconnects during normal operation
I'm using the ESP8266 Wi-Fi SoC to send data to a server, but the connection intermittently drops during normal operation. For instance, from the PowerShell prompt, I can see the counter repeatedly ...
0
votes
0
answers
141
views
Implementing a simple websocket client in spring boot listening to 2 different websocket endpoints - but they always start executing together
I have 2 websocket endpoints producing related messages:
"ws://localhost:8032/posts"
"ws://localhost:8032/comments"
Comments are guaranteed to be published after a referred post ...
0
votes
1
answer
496
views
Jetty 11: Set idle timeout for WebSockets programmatically and via configuration file
I have found a way to set the idle timeout for Jetty 11 WebSocket connections programmatically by invoking factory.setIdleTimeout in an implementation of the JettyWebSocketServlet.configure(...
1
vote
1
answer
96
views
How to deny preSend() in ChannelInterceptor based on custom check via DB call
Within my WebSocketConfig class:
@Configuration
@EnableWebSocketMessageBroker
class WebsocketConfig(<...>)
I override:
@Bean(name = ["csrfChannelInterceptor"])
fun ...
0
votes
0
answers
34
views
Adding a secure websocket over nginx
I have a Java app with a websocket server. It works via websockets. I need to add SSL in Nginx. I added two configurations: one for proxy by websocket and another for secure websocket
server {
...
1
vote
1
answer
250
views
Quarkus Websocket Client Handshake 308 - Upgrade config?
I'm using Quarkus coming back at it, after some years and trying to configure for the first time a WS client, but I'm struggling to find a solution.
Related Dependencies in BoM version 3.7.1
io....
2
votes
0
answers
186
views
Cannot add SSL certificate with Grizzly and Glassfish tyrus on WebSocket server
Currently, I am running a WS (unsecure websocket) server using Grizzly and Tyrus for my messaging app. I have been trying for a while to switch to WSS (websocket secure) but I haven't seen anything ...
0
votes
1
answer
31
views
WebSocket ConvertAndSendUser failed to send message to specific user
I try to do a live-streaming bidding. So when the user wins the bid, he is the only person that will receive a message like "You won. An order has been placed."
@Override
public void ...
0
votes
0
answers
27
views
Android WebSocket received multiple response one by one with OkHttpClient
I am using OkHttpClient to connect to the WebSocket.
I expect the WebSocket response one by one, but now if I send one message it returns once (with multiple responses) only.
Here is what I am ...
0
votes
1
answer
161
views
Android SocketIO EngineIOException: websocket error
I am trying to connect with the SocketIO, but I got this error from the Android side (iOS works):
Here is what I am doing in the Android:
override fun init() = callbackFlow {
val accessToken = ...
1
vote
0
answers
111
views
Subscribe springboot web-socket with Postman
I have created a springboot websocket with a topic
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void ...
0
votes
0
answers
62
views
ServerEndpoint PostConstruct called twice
I am using JSR356 websockets in my web application and I am wondering why the ServerEndpoint PostConstruct method is called twice?!
This is the server.log of my WildFly server:
PushMessageEndpoint: -&...
0
votes
1
answer
399
views
Javalin websockets headers
I am trying to connect to my Javalin-Backend with a websocket in js.
This is my Access-Manager in Javalin:
@Override
public void manage(@NotNull Handler handler, @NotNull Context context, @NotNull ...
0
votes
0
answers
321
views
How to correctly create a web socket connection client in Java?
I can't establish a correct connection to the topic. The server has a spring boot running and a web socket is configured in it:
@Configuration
@EnableWebSocketMessageBroker
public class ...
0
votes
1
answer
180
views
Getting error in jmeter websocket single read sampler
I am getting error when I try use websocket single read sampler to listen to a server for text messages. I have no idea why this is happening.
enter image description here
I expected the jmeter to ...
0
votes
1
answer
27
views
Does CometD support partial websocket messaging
I have application using CometD version 5 that does not support partial messages over websocket. Is it supported in newer version or else do i need to do it in my application. Any java libraries that ...
0
votes
1
answer
119
views
Synchronized issue
I am trying to block the concurrent access to a method , and i didn t succeeded whatever i tried.I tried to sinchronize the method by class (by using synchronized(this) or synchronized at method ...
1
vote
0
answers
204
views
Why my socket connection is breaking after 2 mins after upgrading websocket-jetty-server from 9.4.48.v20220622 to 11.0.12?
websocket-jetty-server 11.0.12 socket connection is breaking after 2 mins
I am using websocket-jetty-server version 11.0.12 to use websocket.
I wanted to use the java verion 17 so I upgraded websocket-...
1
vote
1
answer
277
views
Websocket isn't connected to server in react-native
I am developing mobile app using react native. It includs websocket communication.
In debug mode, all is working well, but websocket isn't connected to server in release mode.
I use built-in library ...
2
votes
1
answer
23
views
SOLVED: Why do the tiles display as 1 column rather than the desired grid?
Using Node and socket.io to make an image-key chatroom using an image keyboard of 11 x 11 image keys.
The tiles (image-key)s here are meant to display as an 11 x 11 grid.
They are instead displaying ...
1
vote
1
answer
665
views
Spring WebSocket Stomp user connection and disconnection event broadcasts
I am using SpringBoot 3 with Stomp. I have defined two brokers:
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/chat", "/connect&...
1
vote
0
answers
191
views
SimpMessagingTemplate not sending messages
Here is my simple React component:
`import React, { useState, useEffect } from 'react';
function App() {const [price, setPrice] = useState(0);
useEffect(() => {const socket = new WebSocket("...
0
votes
1
answer
120
views
EclipseLink can't get the data from PostgreSQL
this is my first stackoverflow question.
I can't read out the data from my PostgreSQL table and I have tried different methods, but I couldn't get it to work. All my services are on the newest version ...
0
votes
0
answers
52
views
Java: How to replace doPost, doGet in deprecated WebSocketServlet class
In older Java versions you could extend a class with WebSocketServlet, and because WebSocketServlet itself extended HttpServlet it was possible to add CRUD method, such as doGet(...), doPost(...) etc ...
1
vote
1
answer
2k
views
Auto reconnect to Binance Websocket after 24 hours
I'm currently experimenting on Binance Websocket (https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams), streaming the candlestick data for processing.
As documented, the stream ...
0
votes
1
answer
137
views
can TextWebSocketFrame be declared with static and final?
In Netty, send messages are like this:
channel.writeAndFlush(new TextWebSocketFrame("Operation Succeed"));
to run this code, nothing abnormal. so I think, argument from writeAndFlush can be ...
0
votes
1
answer
7k
views
Stomp over Websocket: Connection is established but messages are not received on the channel. Probably more related to Javascript
I implement chat using WebSocket and SockJs in the client and spring-websocket on the server, I have established a connection but when I send a message it never gets to the server - or it appears so ...
0
votes
1
answer
465
views
How to close/purge websocket connection from server side with Tomcat
I am using jakarta.websocket on Tomcat and I want my server after some time to close the websocket connection with a connected client. For that, I am calling session.close() which then triggers indeed
...
0
votes
1
answer
189
views
Passing data from object to parent in java
In my project I am trying to implement a event handling for my websocket instances. So I basically have 3 classes:
My AuthClient class which extends a WebsocketClient and has onMessage callback. In ...
0
votes
1
answer
145
views
Java: How to send push notifications to a list of URLs?
Client Side
The client sends a POST call to the server to create a subscription.
The POST call request body contains the URL to which the server should send push notifications.
E.g. POST Request body:
...
1
vote
0
answers
125
views
Java Class parsed to JSON does not output correct Json Object
I use Java (with Quarkus) for the backend.
Vue3 for the frontend.
API and Websockets to transition data between the two.
I am building a chat message application.
So far I was able to send a message ...
1
vote
0
answers
1k
views
karate webSockets : getting invalid handshake response getStatus: 403 Forbidden
While writing karate feature test for websockets i am getting Invalid handshake response while the same endpoint is working when executed with postman.Here is karate feature test
Background:
* def ...
0
votes
0
answers
383
views
Streaming Microphone from Javascript to Java. Unable to convert float 32 array to audio file
I am streaming the audio from microphone using javascript and sending the audio stream from frontend to backend via websocket. In my websocket handle message i can see float array recieving from front ...
1
vote
1
answer
921
views
I have opened multiple websocket client data stream in jetty java with different api and secret calls , how do i close a particular session?
In my current code i had a servlet from which if i create post to the servlet it will open a new websocket client , that mean 10 client connection each running for same purpose but with different api ...
2
votes
1
answer
695
views
How to consume external websocket API in Apache Camel since ahc-ws deprecate?
ahc and ahc-ws (Async Http Client) components have been deprecated in Apache camel version 3.16: https://issues.apache.org/jira/browse/CAMEL-17667.
Is there an alternative for ahc-ws? The component ...
0
votes
0
answers
240
views
How to prevent websocket from closing - Java Endpoint
I'm trying to get input from users with HTML form and send a json object to my Endpoint instance. I use Jackson for deserialization and whenever an exception happens in the decoder (for example if ...
0
votes
1
answer
230
views
Unable to implement websockets on non https server implementing springboot
I've been working on a project with my team for about a week and we still haven't been able to get websockets to work. We're running the whole server on our own machines for testing purposes and we're ...
1
vote
0
answers
412
views
quarkus websocket is not working properly at azure webapp
Issue
Websocket is closed once it receive a message at the client side (browser).
Actual behavior
On the 3rd message I send, I can see the error message at the console that WebSocket is already in ...