Skip to content

Commit c3cbe4e

Browse files
committed
Merge branch 'master' of github.com:doghappy/socket.io-client-csharp into master
2 parents 19411bc + e984a15 commit c3cbe4e

File tree

8 files changed

+28
-17
lines changed

8 files changed

+28
-17
lines changed

src/SocketIOClient.Test/SocketIOTests/V2/ScoketIOV2Creator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
}
14+
},
15+
EIO = 3
1516
});
1617
}
1718

src/SocketIOClient.Test/SocketIOTests/V2/ScoketIOV2NspCreator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
}
14+
},
15+
EIO = 3
1516
});
1617
}
1718

src/SocketIOClient.Test/SocketIOTests/V3/ScoketIOV3Creator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
},
15-
EIO = EIO
14+
}
1615
});
1716
}
1817

src/SocketIOClient.Test/SocketIOTests/V3/ScoketIOV3NspCreator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
},
15-
EIO = EIO
14+
}
1615
});
1716
}
1817

src/SocketIOClient.Test/SocketIOTests/V4/ScoketIOV4Creator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
},
15-
EIO = EIO
14+
}
1615
});
1716
}
1817

src/SocketIOClient.Test/SocketIOTests/V4/ScoketIOV4NspCreator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public SocketIO Create()
1111
Query = new Dictionary<string, string>
1212
{
1313
{ "token", Token }
14-
},
15-
EIO = EIO
14+
}
1615
});
1716
}
1817

src/SocketIOClient.Test/UrlConverterTest.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void HttpWithPortTest()
1414
Uri httpUri = new Uri("http://localhost:3000");
1515
Uri wsUri = urlConverter.HttpToWs(httpUri, new SocketIOOptions());
1616

17-
Assert.AreEqual("ws://localhost:3000/socket.io/?EIO=3&transport=websocket", wsUri.ToString());
17+
Assert.AreEqual("ws://localhost:3000/socket.io/?EIO=4&transport=websocket", wsUri.ToString());
1818
}
1919

2020
[TestMethod]
@@ -24,7 +24,7 @@ public void HttpsWithPortTest()
2424
Uri httpUri = new Uri("https://localhost:3000");
2525
Uri wsUri = urlConverter.HttpToWs(httpUri, new SocketIOOptions());
2626

27-
Assert.AreEqual("wss://localhost:3000/socket.io/?EIO=3&transport=websocket", wsUri.ToString());
27+
Assert.AreEqual("wss://localhost:3000/socket.io/?EIO=4&transport=websocket", wsUri.ToString());
2828
}
2929

3030
[TestMethod]
@@ -34,7 +34,7 @@ public void HttpWithoutPortTest()
3434
Uri httpUri = new Uri("http://localhost");
3535
Uri wsUri = urlConverter.HttpToWs(httpUri, new SocketIOOptions());
3636

37-
Assert.AreEqual("ws://localhost/socket.io/?EIO=3&transport=websocket", wsUri.ToString());
37+
Assert.AreEqual("ws://localhost/socket.io/?EIO=4&transport=websocket", wsUri.ToString());
3838
}
3939

4040
[TestMethod]
@@ -44,7 +44,7 @@ public void HttpsWithoutPortTest()
4444
Uri httpUri = new Uri("https://localhost");
4545
Uri wsUri = urlConverter.HttpToWs(httpUri, new SocketIOOptions());
4646

47-
Assert.AreEqual("wss://localhost/socket.io/?EIO=3&transport=websocket", wsUri.ToString());
47+
Assert.AreEqual("wss://localhost/socket.io/?EIO=4&transport=websocket", wsUri.ToString());
4848
}
4949

5050
[TestMethod]
@@ -61,7 +61,7 @@ public void ParametersTest()
6161
}
6262
});
6363

64-
Assert.AreEqual("wss://localhost/socket.io/?EIO=3&transport=websocket&uid=abc&pwd=123", wsUri.ToString());
64+
Assert.AreEqual("wss://localhost/socket.io/?EIO=4&transport=websocket&uid=abc&pwd=123", wsUri.ToString());
6565
}
6666

6767
[TestMethod]
@@ -79,7 +79,20 @@ public void CustomPathTest()
7979
}
8080
});
8181

82-
Assert.AreEqual("wss://localhost/test/?EIO=3&transport=websocket&uid=abc&pwd=123", wsUri.ToString());
82+
Assert.AreEqual("wss://localhost/test/?EIO=4&transport=websocket&uid=abc&pwd=123", wsUri.ToString());
83+
}
84+
85+
[TestMethod]
86+
public void EIO3Test()
87+
{
88+
var urlConverter = new UrlConverter();
89+
Uri httpUri = new Uri("http://localhost:3000");
90+
Uri wsUri = urlConverter.HttpToWs(httpUri, new SocketIOOptions
91+
{
92+
EIO = 3
93+
});
94+
95+
Assert.AreEqual("ws://localhost:3000/socket.io/?EIO=3&transport=websocket", wsUri.ToString());
8396
}
8497
}
8598
}

src/SocketIOClient/SocketIOOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public sealed class SocketIOOptions
99
public SocketIOOptions()
1010
{
1111
RandomizationFactor = new Random().NextDouble();
12-
EIO = 3;
12+
EIO = 4;
1313
}
1414

1515
public string Path { get; set; } = "/socket.io";

0 commit comments

Comments
 (0)