Skip to content

[x 2.0.3 ,the client close when your server to send chinese sentence,] #3117

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

Closed
1 of 2 tasks
wuteng606 opened this issue Nov 17, 2017 · 8 comments
Closed
1 of 2 tasks

Comments

@wuteng606
Copy link

wuteng606 commented Nov 17, 2017

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • report a bug
  • request a feature

Current behaviour

Steps to reproduce (if the current behaviour is a bug)

Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.

Expected behaviour

Setup

  • OS:
  • browser:
  • socket.io version:

Other information (e.g. stacktraces, related issues, suggestions how to fix)

@wuteng606
Copy link
Author

in 2.0.3 ,the client will be closed when your server send a chinese sentence. the error is transport close

@gooddaddy
Copy link

@wuteng606
me too(i use socket.io 2.0.4)

@Chopinsky
Copy link

Chopinsky commented Nov 23, 2017

I couldn't reproduce this issue, I'm using express 4.16.2 and socket.io 2.0.4, and messages containing Chinese characters can be sent to/from the express server.

I suspect that some other errors took place and closed the socket connection other than the Chinese characters.

@gooddaddy
Copy link

gooddaddy commented Nov 24, 2017

@Chopinsky
I'm using express 4.16.2 and socket.io 2.0.4 too,and I did it like this
io.of("/webPush").connected[socketId].emit('scanLogin',"一发中文就断网,啥玩意啊");
then the error is transport close.
if I use io.of("/webPush").connected[socketId].emit('scanLogin',"111");
it work well。

Are there any other settings that need to be set?(是否有其他的设置需要设置?)

@gooddaddy
Copy link

gooddaddy commented Nov 24, 2017

@Chopinsky
I konw why,maybe it was that I use “browser-sync” in debug-environment。“browser-sync” use socket.io(version 1.6.0)。I work well in release-environment。

I have solved this problem.The reason for this problem is the configuration of nginx。

Use the following configuration to work properly

   server {
        listen       3003;
        #server_name  192.168.7.114;

    location / {
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header Host $host;
         proxy_http_version 1.1;
         proxy_pass  	http://192.168.7.114:3001;
    }

   location /socket.io {
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header Host $host;
             proxy_http_version 1.1;
             proxy_pass  	http://192.168.7.114:3000;
   }
}

@deanshub
Copy link

deanshub commented Dec 6, 2017

checkout #3126

@awtmeng
Copy link

awtmeng commented Feb 1, 2018

@gooddaddy
According to your configuration, it doesn't take effect

@darrachequesne
Copy link
Member

For future readers: I think that's because the version of the client and the server did not match (v1 and v2 were indeed incompatible).

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

6 participants