SockJS client not connecting to Grails server - port issue or something else? The Next CEO of Stack OverflowWebSocket with Sockjs & Spring 4 but without StompNodeJS + SockJS + STOMP connection to Java Springspring websocket sockjs connection lost before establishedWebsockets server with SockJS (NodeJS) + STOMP ClientsJava SockJS Spring client and message sizeHow to combine Spring Security and js sockjs-clientHow set the nativeHeaders to Spring Java SockJS client on CONNECT frameStomp SockJs client + server SpringWebsockets using SockJS/ Grails for chatSping Boot + Sockjs client offline connecting issues
what's the use of '% to gdp' type of variables?
Graph of the history of databases
Players Circumventing the limitations of Wish
Is fine stranded wire ok for main supply line?
Is there a reasonable and studied concept of reduction between regular languages?
Can this note be analyzed as a non-chord tone?
Scary film where a woman has vaginal teeth
Can Sneak Attack be used when hitting with an improvised weapon?
free fall ellipse or parabola?
Is French Guiana a (hard) EU border?
Are the names of these months realistic?
Film where the government was corrupt with aliens, people sent to kill aliens are given rigged visors not showing the right aliens
Cannot shrink btrfs filesystem although there is still data and metadata space left : ERROR: unable to resize '/home': No space left on device
Spaces in which all closed sets are regular closed
From jafe to El-Guest
Is there an equivalent of cd - for cp or mv
Strange use of "whether ... than ..." in official text
Why don't programming languages automatically manage the synchronous/asynchronous problem?
What steps are necessary to read a Modern SSD in Medieval Europe?
Help/tips for a first time writer?
Audio Conversion With ADS1243
How to Implement Deterministic Encryption Safely in .NET
What is the process for purifying your home if you believe it may have been previously used for pagan worship?
What flight has the highest ratio of timezone difference to flight time?
SockJS client not connecting to Grails server - port issue or something else?
The Next CEO of Stack OverflowWebSocket with Sockjs & Spring 4 but without StompNodeJS + SockJS + STOMP connection to Java Springspring websocket sockjs connection lost before establishedWebsockets server with SockJS (NodeJS) + STOMP ClientsJava SockJS Spring client and message sizeHow to combine Spring Security and js sockjs-clientHow set the nativeHeaders to Spring Java SockJS client on CONNECT frameStomp SockJs client + server SpringWebsockets using SockJS/ Grails for chatSping Boot + Sockjs client offline connecting issues
I'm using SockJS and STOMP on the front end in a simple standard way to try and connect to a Grails based server. Front and back end are on different servers (I'm in a work team so can't change this), front on port 4200 and back on 8080. Looking at the network connection in Firefox dev tools it seems SockJS is trying to connect on port 4200:
Request URL: http://localhost:4200/sockjs-node/842/cxrvvsec/websocket
when I need it to connect to the backend server on 8080. Is there a way to change this? I'm specifying 8080 in my connection code:
private serverUrl = 'http://localhost:8080/stomp'
private sockjsclient = null; // SockJS socket that connects to the server (preferably using a WebSocket)
private stompClient = null; // Stomp client that handles sending messages over the WebSocket
this.sockjsclient = new SockJS(this.serverUrl); // Create a new SockJS socket
this.stompClient = Stomp.over(this.sockjsclient); // Create a STOMP client to send messages over the socket
let that = this;
console.log(this.sockjsclient, this.stompClient)
this.stompClient.connect(, function()
console.log('*** subscribeToTopic: CONNECTION ESTABLISHED')
return that.stompClient.subscribe(topic, (message) => callbackfn);
)
Browser console output:
Opening Web Socket...
Whoops! Lost connection to http://localhost:4200/stomp
Thanks
websocket spring-websocket stomp sockjs
add a comment |
I'm using SockJS and STOMP on the front end in a simple standard way to try and connect to a Grails based server. Front and back end are on different servers (I'm in a work team so can't change this), front on port 4200 and back on 8080. Looking at the network connection in Firefox dev tools it seems SockJS is trying to connect on port 4200:
Request URL: http://localhost:4200/sockjs-node/842/cxrvvsec/websocket
when I need it to connect to the backend server on 8080. Is there a way to change this? I'm specifying 8080 in my connection code:
private serverUrl = 'http://localhost:8080/stomp'
private sockjsclient = null; // SockJS socket that connects to the server (preferably using a WebSocket)
private stompClient = null; // Stomp client that handles sending messages over the WebSocket
this.sockjsclient = new SockJS(this.serverUrl); // Create a new SockJS socket
this.stompClient = Stomp.over(this.sockjsclient); // Create a STOMP client to send messages over the socket
let that = this;
console.log(this.sockjsclient, this.stompClient)
this.stompClient.connect(, function()
console.log('*** subscribeToTopic: CONNECTION ESTABLISHED')
return that.stompClient.subscribe(topic, (message) => callbackfn);
)
Browser console output:
Opening Web Socket...
Whoops! Lost connection to http://localhost:4200/stomp
Thanks
websocket spring-websocket stomp sockjs
add a comment |
I'm using SockJS and STOMP on the front end in a simple standard way to try and connect to a Grails based server. Front and back end are on different servers (I'm in a work team so can't change this), front on port 4200 and back on 8080. Looking at the network connection in Firefox dev tools it seems SockJS is trying to connect on port 4200:
Request URL: http://localhost:4200/sockjs-node/842/cxrvvsec/websocket
when I need it to connect to the backend server on 8080. Is there a way to change this? I'm specifying 8080 in my connection code:
private serverUrl = 'http://localhost:8080/stomp'
private sockjsclient = null; // SockJS socket that connects to the server (preferably using a WebSocket)
private stompClient = null; // Stomp client that handles sending messages over the WebSocket
this.sockjsclient = new SockJS(this.serverUrl); // Create a new SockJS socket
this.stompClient = Stomp.over(this.sockjsclient); // Create a STOMP client to send messages over the socket
let that = this;
console.log(this.sockjsclient, this.stompClient)
this.stompClient.connect(, function()
console.log('*** subscribeToTopic: CONNECTION ESTABLISHED')
return that.stompClient.subscribe(topic, (message) => callbackfn);
)
Browser console output:
Opening Web Socket...
Whoops! Lost connection to http://localhost:4200/stomp
Thanks
websocket spring-websocket stomp sockjs
I'm using SockJS and STOMP on the front end in a simple standard way to try and connect to a Grails based server. Front and back end are on different servers (I'm in a work team so can't change this), front on port 4200 and back on 8080. Looking at the network connection in Firefox dev tools it seems SockJS is trying to connect on port 4200:
Request URL: http://localhost:4200/sockjs-node/842/cxrvvsec/websocket
when I need it to connect to the backend server on 8080. Is there a way to change this? I'm specifying 8080 in my connection code:
private serverUrl = 'http://localhost:8080/stomp'
private sockjsclient = null; // SockJS socket that connects to the server (preferably using a WebSocket)
private stompClient = null; // Stomp client that handles sending messages over the WebSocket
this.sockjsclient = new SockJS(this.serverUrl); // Create a new SockJS socket
this.stompClient = Stomp.over(this.sockjsclient); // Create a STOMP client to send messages over the socket
let that = this;
console.log(this.sockjsclient, this.stompClient)
this.stompClient.connect(, function()
console.log('*** subscribeToTopic: CONNECTION ESTABLISHED')
return that.stompClient.subscribe(topic, (message) => callbackfn);
)
Browser console output:
Opening Web Socket...
Whoops! Lost connection to http://localhost:4200/stomp
Thanks
websocket spring-websocket stomp sockjs
websocket spring-websocket stomp sockjs
asked Mar 7 at 18:17
Alex KerrAlex Kerr
250119
250119
add a comment |
add a comment |
0
active
oldest
votes
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050390%2fsockjs-client-not-connecting-to-grails-server-port-issue-or-something-else%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050390%2fsockjs-client-not-connecting-to-grails-server-port-issue-or-something-else%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown