title: nginx socket io infinite connected problem from c#
body: <p>I'm using nginx and socket io, and the socket io version is 2.3.</p>
  <p>For all ip, the connection is good, but only certain IPs have infinite connections.</p>
  <p>this is my node code.</p>
  <pre><code>const io = require('socket.io').listen(ISLIVE ? 3000 : 10030, {
      pingTimeout: 50000,
      pringInterval: 25000,
      cookie: false,
      reconnectionDelay: 1000,
      reconnectionDelayMax: 5000,
  });
  
  io.on(&quot;connection&quot;, (socket) =&gt; {
  
      const clientIp = socket.handshake.headers['x-forwarded-for'] || 
      socket.conn.remoteAddress.split(&quot;:&quot;)[3];
      console.log(clientIp);
  }
  
  
  124.121.177.245 - - [25/Nov/2021:10:16:56 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket    HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  184.22.97.6 - - [25/Nov/2021:10:16:57 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:16:58 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:00 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  58.11.25.243 - - [25/Nov/2021:10:17:01 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 135 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:02 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:04 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  223.24.156.219 - - [25/Nov/2021:10:17:05 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:06 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:07 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:09 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:09 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:11 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:13 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:15 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:15 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:17 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:19 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:21 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:21 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:23 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:23 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:23 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:25 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:25 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:26 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:27 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:28 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:29 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:29 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:30 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:31 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:32 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:32 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:33 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 123 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.121.177.245 - - [25/Nov/2021:10:17:34 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  124.120.245.35 - - [25/Nov/2021:10:17:35 +0900] &quot;GET /socket.io/?EIO=4&amp;transport=websocket HTTP/1.1&quot; 101 96 &quot;-&quot; &quot;websocket-sharp/1.0&quot;
  </code></pre>
  <p>184.22.97.6 line 2</p>
  <p>58.11.25.243 line 5</p>
  <p>It's a normal ip.</p>
  <p>but ip 124.121.177.245 and ip 124.120.245.35
  These are not connected properly and only connect continues to occur.</p>
  <p>my nginx cofing code :</p>
  <pre><code>location /socket.io/ {
      proxy_pass http://127.0.0.1:3000/socket.io/;
      proxy_http_version 1.1;
  
      proxy_read_timeout 70s;
      proxy_send_timeout 70s;
      proxy_connect_timeout 70s;
  
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection &quot;Upgrade&quot;;
      proxy_hide_header 'Access-Control-Allow-Origin';
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_redirect off;
  
      #access_log /var/log/nginx/node_access.log;
      #error_log off;
      #error_log /var/log/nginx/node_error.log;
  }
  </code></pre>
  <p>and node serverside log in socket connect:</p>
  <pre><code>2021-11-25T11:30:02: 124.121.177.245 ## uyk6qfP-7mfLwo6nAXof
  2021-11-25T11:30:03: 124.121.177.245 ## uKjvtrVUNUS9BY2hAXog
  2021-11-25T11:30:05: 124.121.177.245 ## V0ktwTb4MMs-MkeiAXoh
  2021-11-25T11:30:08: 124.121.177.245 ## Tvw6kt3ACI5cJLG5AXoj
  2021-11-25T11:30:09: 124.121.177.245 ## FQCdeSsYZeFmHHWhAXok
  2021-11-25T11:30:12: 124.121.177.245 ## mzp-qXV_Bu-VauzxAXol
  2021-11-25T11:30:14: 124.121.177.245 ## yWek8BPYsAFdh9rjAXom
  2021-11-25T11:30:17: 124.121.177.245 ## r39JyH-Fcq4_E32hAXoo
  2021-11-25T11:30:19: 124.121.177.245 ## rbxCJ8itf4aj9YuVAXop
  2021-11-25T11:30:21: 124.121.177.245 ## jXaMg0ob1IoNa5p6AXor
  </code></pre>
  <p>I heard that those ips communicate through Wi-Fi, but I don't know what the problem is.</p>