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

Jsclient (v.2.0.2) send null data with SSE when jsonp is enabled #2927

Closed
kocakden opened this issue Mar 12, 2014 · 4 comments
Closed

Jsclient (v.2.0.2) send null data with SSE when jsonp is enabled #2927

kocakden opened this issue Mar 12, 2014 · 4 comments
Milestone

Comments

@kocakden
Copy link

Hi,

When I use newest javascript client to connect to my server using SSE and jsonp enabled, the data I sent is received null. I tried the same code with version 2.0.1 and I don't get the same error.
Here is my js code

        var url = "http://my.test.local/echo";
        var conn = $.connection(url);
        conn.logging = true;

        conn.error(function (error) {
            console.log('SignalR error: ' + error);
        });
        conn.connectionSlow(function () {
            console.log("We are currently experiencing difficulties with the connection.");
        });
        conn.start({ jsonp: true, transport: ['webSockets', 'serverSentEvents', 'longPolling'] }).done(function () {
            conn.send("data");
        });

if I set the jsonp: false or use the old version (2.0.1), the data is sent correctly.

@DamianEdwards DamianEdwards added this to the 2.1.0 Beta milestone Apr 2, 2014
@DamianEdwards
Copy link
Member

We added support for cross-domain SSE in 2.0.2 but appears it might have an issue here. We'll take a look.

@abnanda1
Copy link
Contributor

@kocakden you should not set jsonp to true and everything should work fine. If we need to use jsonp because CORS is not supported, we'll do that in SignalR you don't need to set anything explicitly. We'll consider removing this option in the future versions to avoid any confusion.

@abnanda1 abnanda1 modified the milestones: Backlog, 2.1.0 Beta Apr 25, 2014
@kocakden
Copy link
Author

kocakden commented May 6, 2014

@abnanda1 I stopped using jsonp option and updated my server to set the header values (i.e. Access-Control-Allow-Origin) on response.

@DamianEdwards
Copy link
Member

Closing as it appears this was a usage issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants