Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-library-url in sockjs config is not working [SPR-12874] #17472

Closed
spring-issuemaster opened this issue Apr 1, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Apr 1, 2015

Jiji Sasidharan opened SPR-12874 and commented

The sockjs client library url configured in websocket namespace element sockjs is not getting set to AbstractSockJsService.

for eg, the configuration is

<websocket:message-broker application-destination-prefix="/quotes">
	<websocket:stomp-endpoint path="/stream" allowed-origins="*">
		<websocket:sockjs client-library-url="../scripts/sockjs.js" />
	</websocket:stomp-endpoint>
	<websocket:simple-broker prefix="/topic" />
</websocket:message-broker>

And the generated iframe in IE8 is

<IFRAME style="POSITION: absolute; DISPLAY: none" src="http://localhost:4080/fxserver/fxstream/iframe.html#uz245z2d" onerror="null">
<HTML><HEAD>
<META content=IE=edge http-equiv=X-UA-Compatible>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<SCRIPT>
    document.domain = document.domain;
    _sockjs_onload = function(){SockJS.bootstrap_iframe();};
  </SCRIPT>

<SCRIPT src="https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"></SCRIPT>
</HEAD>
<BODY>
<H2>Don't panic!</H2>
<P>This is a SockJS hidden iframe. It's used for cross domain magic.</P></BODY></HTML>
</IFRAME>

The generated code is still using the CDN url rather than url in the config.

I checked WebSocketNamespaceUtil and the logic to read the client-library-url from application context xml and set to AbstractSockJsService is missing in WebSocketNamespaceUtil
https://github.com/spring-projects/spring-framework/blob/master/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java#L104


Affects: 4.1.6

Referenced from: commits 100d75d, e2a55ce

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 1, 2015

Brian Clozel commented

Thanks for this report!
This is fixed and will be shortly available in the SNAPSHOT versions:

  • 4.2.0-BUILD-SNAPSHOT
  • 4.1.7-BUILD-SNAPSHOT

You can fetch those by using the https://repo.spring.io/libs-snapshot artifact repostory in your POM or build.gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.