From fa368ca1a366f62f26ca5c95200a02646fbae41d Mon Sep 17 00:00:00 2001 From: theskhan Date: Wed, 31 Aug 2022 21:22:38 +0530 Subject: [PATCH 01/12] Migrated to .Net Core 6.0 --- .../config/applicationhost.config | 962 ++++++++++++++++++ Example/AssemblyInfo.cs | 26 - Example/Example.csproj | 83 +- Example2/App.config | 7 - Example2/AssemblyInfo.cs | 26 - Example2/Example2.csproj | 90 +- Example2/Program.cs | 74 +- Example2/config.json | 4 + Example3/App.config | 8 - Example3/AssemblyInfo.cs | 26 - Example3/Example3.csproj | 96 +- Example3/Program.cs | 74 +- Example3/config.json | 5 + websocket-sharp.sln | 34 +- websocket-sharp/AssemblyInfo.cs | 26 - websocket-sharp/websocket-sharp.csproj | 154 +-- websocket-sharp/websocket-sharp.snk | Bin 596 -> 0 bytes 17 files changed, 1138 insertions(+), 557 deletions(-) create mode 100644 .vs/websocket-sharp/config/applicationhost.config delete mode 100644 Example/AssemblyInfo.cs delete mode 100644 Example2/App.config delete mode 100644 Example2/AssemblyInfo.cs create mode 100644 Example2/config.json delete mode 100644 Example3/App.config delete mode 100644 Example3/AssemblyInfo.cs create mode 100644 Example3/config.json delete mode 100644 websocket-sharp/AssemblyInfo.cs delete mode 100644 websocket-sharp/websocket-sharp.snk diff --git a/.vs/websocket-sharp/config/applicationhost.config b/.vs/websocket-sharp/config/applicationhost.config new file mode 100644 index 000000000..71f66965f --- /dev/null +++ b/.vs/websocket-sharp/config/applicationhost.config @@ -0,0 +1,962 @@ + + + + + + +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/AssemblyInfo.cs b/Example/AssemblyInfo.cs deleted file mode 100644 index 9a9617356..000000000 --- a/Example/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Example")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("sta.blockhead")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/Example/Example.csproj b/Example/Example.csproj index ee89d9f6e..6c21f3e29 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -1,65 +1,18 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568} - Exe - Example - example - v3.5 - - - true - full - false - bin\Debug - DEBUG - prompt - 4 - true - - - none - false - bin\Release - prompt - 4 - true - - - true - full - false - bin\Debug_Ubuntu - DEBUG - prompt - 4 - true - - - none - false - bin\Release_Ubuntu - prompt - 4 - true - - - - - - - - {B357BAC7-529E-4D81-A0D2-71041B19C8DE} - websocket-sharp - - - - - - - - \ No newline at end of file + + + + .net6.0 + enable + enable + + + + + + + + + + + + diff --git a/Example2/App.config b/Example2/App.config deleted file mode 100644 index 3a02690ea..000000000 --- a/Example2/App.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Example2/AssemblyInfo.cs b/Example2/AssemblyInfo.cs deleted file mode 100644 index 55cd94f77..000000000 --- a/Example2/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Example2")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("sta.blockhead")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/Example2/Example2.csproj b/Example2/Example2.csproj index 685a1ef6d..2fe06c7bc 100644 --- a/Example2/Example2.csproj +++ b/Example2/Example2.csproj @@ -1,70 +1,20 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {B81A24C8-25BB-42B2-AF99-1E1EACCE74C7} - Exe - Example2 - example2 - v3.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - - - none - false - bin\Release - prompt - 4 - true - - - true - full - false - bin\Debug_Ubuntu - DEBUG; - prompt - 4 - true - - - none - false - bin\Release_Ubuntu - prompt - 4 - true - - - - - - - - - - - - - - - {B357BAC7-529E-4D81-A0D2-71041B19C8DE} - websocket-sharp - - - - - - \ No newline at end of file + + + + .net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/Example2/Program.cs b/Example2/Program.cs index 7b024a0ee..74deec19c 100644 --- a/Example2/Program.cs +++ b/Example2/Program.cs @@ -1,3 +1,4 @@ +using Microsoft.Extensions.Configuration; using System; using System.Configuration; using System.Security.Cryptography.X509Certificates; @@ -11,13 +12,20 @@ public class Program { public static void Main (string[] args) { - // Create a new instance of the WebSocketServer class. - // - // If you would like to provide the secure connection, you should - // create a new instance with the 'secure' parameter set to true or - // with a wss scheme WebSocket URL. - var wssv = new WebSocketServer (4649); + IConfiguration appConfig = new ConfigurationBuilder() + .AddJsonFile("config.json", true, true) + .AddEnvironmentVariables() + .Build(); + + + // Create a new instance of the WebSocketServer class. + // + // If you would like to provide the secure connection, you should + // create a new instance with the 'secure' parameter set to true or + // with a wss scheme WebSocket URL. + + var wssv = new WebSocketServer (4649); //var wssv = new WebSocketServer (5963, true); //var wssv = new WebSocketServer (System.Net.IPAddress.Any, 4649); @@ -50,38 +58,38 @@ public static void Main (string[] args) // To change the logging level. wssv.Log.Level = LogLevel.Trace; - // To change the wait time for the response to the WebSocket Ping or Close. - //wssv.WaitTime = TimeSpan.FromSeconds (2); + // To change the wait time for the response to the WebSocket Ping or Close. + //wssv.WaitTime = TimeSpan.FromSeconds (2); - // Not to remove the inactive sessions periodically. - //wssv.KeepClean = false; + // Not to remove the inactive sessions periodically. + //wssv.KeepClean = false; #endif - // To provide the secure connection. - /* - var cert = ConfigurationManager.AppSettings["ServerCertFile"]; - var passwd = ConfigurationManager.AppSettings["CertFilePassword"]; - wssv.SslConfiguration.ServerCertificate = new X509Certificate2 (cert, passwd); - */ + // To provide the secure connection. - // To provide the HTTP Authentication (Basic/Digest). - /* - wssv.AuthenticationSchemes = AuthenticationSchemes.Basic; - wssv.Realm = "WebSocket Test"; - wssv.UserCredentialsFinder = id => { - var name = id.Name; - - // Return user name, password, and roles. - return name == "nobita" - ? new NetworkCredential (name, "password", "gunfighter") - : null; // If the user credentials are not found. - }; - */ + //var cert = appConfig["ServerCertFile"]; + //var passwd = appConfig["CertFilePassword"]; + //wssv.SslConfiguration.ServerCertificate = new X509Certificate2(cert, passwd); + + + // To provide the HTTP Authentication (Basic/Digest). + /* + wssv.AuthenticationSchemes = AuthenticationSchemes.Basic; + wssv.Realm = "WebSocket Test"; + wssv.UserCredentialsFinder = id => { + var name = id.Name; + + // Return user name, password, and roles. + return name == "nobita" + ? new NetworkCredential (name, "password", "gunfighter") + : null; // If the user credentials are not found. + }; + */ - // To resolve to wait for socket in TIME_WAIT state. - //wssv.ReuseAddress = true; + // To resolve to wait for socket in TIME_WAIT state. + //wssv.ReuseAddress = true; - // Add the WebSocket services. - wssv.AddWebSocketService ("/Echo"); + // Add the WebSocket services. + wssv.AddWebSocketService ("/Echo"); wssv.AddWebSocketService ("/Chat"); // Add the WebSocket service with initializing. diff --git a/Example2/config.json b/Example2/config.json new file mode 100644 index 000000000..7f802ac46 --- /dev/null +++ b/Example2/config.json @@ -0,0 +1,4 @@ +{ + "CertFilePassword": "password", + "ServerCertFile": "/path/to/cert.pfx" +} \ No newline at end of file diff --git a/Example3/App.config b/Example3/App.config deleted file mode 100644 index fa624b42b..000000000 --- a/Example3/App.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/Example3/AssemblyInfo.cs b/Example3/AssemblyInfo.cs deleted file mode 100644 index b9a88a257..000000000 --- a/Example3/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Example3")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("sta.blockhead")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/Example3/Example3.csproj b/Example3/Example3.csproj index ce4fe265c..898402425 100644 --- a/Example3/Example3.csproj +++ b/Example3/Example3.csproj @@ -1,76 +1,20 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {C648BA25-77E5-4A40-A97F-D0AA37B9FB26} - Exe - Example3 - example3 - v3.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - - - none - false - bin\Release - prompt - 4 - true - - - true - full - false - bin\Debug_Ubuntu - DEBUG; - prompt - 4 - true - - - none - false - bin\Release_Ubuntu - prompt - 4 - true - - - - - - - - - - - - - - - {B357BAC7-529E-4D81-A0D2-71041B19C8DE} - websocket-sharp - - - - - - - - - - - - \ No newline at end of file + + + + .net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/Example3/Program.cs b/Example3/Program.cs index b338e10b3..df66dbbc3 100644 --- a/Example3/Program.cs +++ b/Example3/Program.cs @@ -1,3 +1,4 @@ +using Microsoft.Extensions.Configuration; using System; using System.Configuration; using System.Security.Cryptography.X509Certificates; @@ -12,13 +13,18 @@ public class Program { public static void Main (string[] args) { - // Create a new instance of the HttpServer class. - // - // If you would like to provide the secure connection, you should - // create a new instance with the 'secure' parameter set to true or - // with an https scheme HTTP URL. - - var httpsv = new HttpServer (4649); + IConfiguration appConfig = new ConfigurationBuilder() + .AddJsonFile("config.json", true, true) + .AddEnvironmentVariables() + .Build(); + + // Create a new instance of the HttpServer class. + // + // If you would like to provide the secure connection, you should + // create a new instance with the 'secure' parameter set to true or + // with an https scheme HTTP URL. + + var httpsv = new HttpServer (4649); //var httpsv = new HttpServer (5963, true); //var httpsv = new HttpServer (System.Net.IPAddress.Any, 4649); @@ -51,38 +57,38 @@ public static void Main (string[] args) // To change the logging level. httpsv.Log.Level = LogLevel.Trace; - // To change the wait time for the response to the WebSocket Ping or Close. - //httpsv.WaitTime = TimeSpan.FromSeconds (2); + // To change the wait time for the response to the WebSocket Ping or Close. + //httpsv.WaitTime = TimeSpan.FromSeconds (2); - // Not to remove the inactive WebSocket sessions periodically. - //httpsv.KeepClean = false; + // Not to remove the inactive WebSocket sessions periodically. + //httpsv.KeepClean = false; #endif - // To provide the secure connection. - /* - var cert = ConfigurationManager.AppSettings["ServerCertFile"]; - var passwd = ConfigurationManager.AppSettings["CertFilePassword"]; - httpsv.SslConfiguration.ServerCertificate = new X509Certificate2 (cert, passwd); - */ + // To provide the secure connection. - // To provide the HTTP Authentication (Basic/Digest). - /* - httpsv.AuthenticationSchemes = AuthenticationSchemes.Basic; - httpsv.Realm = "WebSocket Test"; - httpsv.UserCredentialsFinder = id => { - var name = id.Name; - - // Return user name, password, and roles. - return name == "nobita" - ? new NetworkCredential (name, "password", "gunfighter") - : null; // If the user credentials are not found. - }; - */ + //var cert = appConfig["ServerCertFile"]; + //var passwd = appConfig["CertFilePassword"]; + //httpsv.SslConfiguration.ServerCertificate = new X509Certificate2(cert, passwd); + + + // To provide the HTTP Authentication (Basic/Digest). + /* + httpsv.AuthenticationSchemes = AuthenticationSchemes.Basic; + httpsv.Realm = "WebSocket Test"; + httpsv.UserCredentialsFinder = id => { + var name = id.Name; + + // Return user name, password, and roles. + return name == "nobita" + ? new NetworkCredential (name, "password", "gunfighter") + : null; // If the user credentials are not found. + }; + */ - // To resolve to wait for socket in TIME_WAIT state. - //httpsv.ReuseAddress = true; + // To resolve to wait for socket in TIME_WAIT state. + //httpsv.ReuseAddress = true; - // Set the document root path. - httpsv.DocumentRootPath = ConfigurationManager.AppSettings["DocumentRootPath"]; + // Set the document root path. + httpsv.DocumentRootPath = appConfig["DocumentRootPath"]; // Set the HTTP GET request event. httpsv.OnGet += (sender, e) => { diff --git a/Example3/config.json b/Example3/config.json new file mode 100644 index 000000000..63f1f2a6b --- /dev/null +++ b/Example3/config.json @@ -0,0 +1,5 @@ +{ + "CertFilePassword": "password", + "ServerCertFile": "/path/to/cert.pfx", + "DocumentRootPath": "../../Public" +} \ No newline at end of file diff --git a/websocket-sharp.sln b/websocket-sharp.sln index 6ff1c0362..da4379805 100644 --- a/websocket-sharp.sln +++ b/websocket-sharp.sln @@ -1,7 +1,9 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "websocket-sharp", "websocket-sharp\websocket-sharp.csproj", "{B357BAC7-529E-4D81-A0D2-71041B19C8DE}" +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32407.343 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "websocket-sharp", "websocket-sharp\websocket-sharp.csproj", "{B357BAC7-529E-4D81-A0D2-71041B19C8DE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{52805AEC-EFB1-4F42-BB8E-3ED4E692C568}" EndProject @@ -11,20 +13,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3", "Example3\Exampl EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU Debug_Ubuntu|Any CPU = Debug_Ubuntu|Any CPU + Debug|Any CPU = Debug|Any CPU Release_Ubuntu|Any CPU = Release_Ubuntu|Any CPU + Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug_Ubuntu|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug_Ubuntu|Any CPU.Build.0 = Debug_Ubuntu|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release_Ubuntu|Any CPU.ActiveCfg = Release_Ubuntu|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release|Any CPU.Build.0 = Release|Any CPU {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug_Ubuntu|Any CPU {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug_Ubuntu|Any CPU.Build.0 = Debug_Ubuntu|Any CPU {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -33,6 +27,14 @@ Global {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release|Any CPU.Build.0 = Release|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug_Ubuntu|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug_Ubuntu|Any CPU.Build.0 = Debug_Ubuntu|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release_Ubuntu|Any CPU.ActiveCfg = Release_Ubuntu|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52805AEC-EFB1-4F42-BB8E-3ED4E692C568}.Release|Any CPU.Build.0 = Release|Any CPU {B81A24C8-25BB-42B2-AF99-1E1EACCE74C7}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug_Ubuntu|Any CPU {B81A24C8-25BB-42B2-AF99-1E1EACCE74C7}.Debug_Ubuntu|Any CPU.Build.0 = Debug_Ubuntu|Any CPU {B81A24C8-25BB-42B2-AF99-1E1EACCE74C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -50,6 +52,12 @@ Global {C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release|Any CPU.ActiveCfg = Release|Any CPU {C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1C4CF734-97A6-4667-94E9-AC5C96FFEB8A} + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = websocket-sharp\websocket-sharp.csproj Policies = $0 diff --git a/websocket-sharp/AssemblyInfo.cs b/websocket-sharp/AssemblyInfo.cs deleted file mode 100644 index c85deaa45..000000000 --- a/websocket-sharp/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("websocket-sharp")] -[assembly: AssemblyDescription("A C# implementation of the WebSocket protocol client and server")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("websocket-sharp.dll")] -[assembly: AssemblyCopyright("sta.blockhead")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.2.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index 0860c0313..079bc2efa 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -1,149 +1,9 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {B357BAC7-529E-4D81-A0D2-71041B19C8DE} - Library - WebSocketSharp - websocket-sharp - v3.5 - true - websocket-sharp.snk + .net6.0 + enable + enable - - true - full - false - bin\Debug - DEBUG - prompt - 4 - false - - - none - false - bin\Release - prompt - 4 - false - - - true - full - false - bin\Debug_Ubuntu - DEBUG - prompt - 4 - false - - - none - false - bin\Release_Ubuntu - prompt - 4 - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + diff --git a/websocket-sharp/websocket-sharp.snk b/websocket-sharp/websocket-sharp.snk deleted file mode 100644 index a2546f385ff1c28221f1071dd2fbc1870d728eb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONaL0000f7yF6+!;$wZ%ZuV+(mw^0ZDpvQV{)eT z)hzOzAo>fyaBB95ev6PlIrVnPNZ`ABvU}~*5T_asaF`E&^h;9-(xvYSmgrHTIc_N+d4!r0J+k@O7F^N!rZ!?-v-48IrNAb7!} z-N_==YbBhM_zb%3vcPBeECpwQOr<(i6$!ynrQ~`QXjiMFwVBazO>@JrfgI51ivGl6 zRjei2J2>~wP7}hz?AO{)>lh*();UW|5NUR0!Ji$O!OQ_E@UT|!^m$J!!@8AkltT%j z@^-wS`8NxnHzsxMW{zi$Sgj3%PBZ_5qAu2Olh=Q!lDnQk=0}kkW2jUYzmul4bgJIL zlK?W_`r?N;Z(!Kc`z;*hfOxrjI{zF803Sg&r~jaQ?Y?Fa8?Az+3a++ht8(mR9-o|j zE@`6|n4@2Af4?zHoP|-_#;rVGqar>7nH%|Nigv24jWsE z$LIC>T!MfxCrw6m*qpp=DPHF19B*63GF@WFjU6vWTmP4b`Oq(FIRY0(-TN1xl?|1D z-Sj2XD0j7$83O-B-{7UHg(P)vanCZOjten@X*^b4ZsM;$Wnsvy271`V8$NH_bgN{j zPL(SOf2I?l4(?fnuwJ_P05C5xZ~dI4vhml_=<z#%yL*k|m=6 From 0219f9a25cf80a542d609a8f655748b138490cc0 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 21:27:35 +0530 Subject: [PATCH 02/12] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 27fb489d3..06fc59d06 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ## Welcome to websocket-sharp! ## +Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not still merged even afetr an year. I have created this fork and updated all references to .Net 6.0. All example projects also updated to .Net 6.0. + websocket-sharp supports: - [RFC 6455](#supported-websocket-specifications) From 93aff21cc48b76f46393b6a841153e6bd02f33a0 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 21:32:32 +0530 Subject: [PATCH 03/12] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 06fc59d06..0de7cfc73 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ ![Logo](websocket-sharp_logo.png) -## Welcome to websocket-sharp! ## +# Welcome to websocket-sharp! # + +## Important Notes ## +## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net 6.0. All example projects also updated to .Net 6.0. ## + -Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not still merged even afetr an year. I have created this fork and updated all references to .Net 6.0. All example projects also updated to .Net 6.0. websocket-sharp supports: From dc581c2689a828d036a0639e203634e121a4d6f9 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 21:47:39 +0530 Subject: [PATCH 04/12] Create dotnet.yml --- .github/workflows/dotnet.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 000000000..e5c95d6aa --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,25 @@ +name: .NET + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal From 3f6f38a5e0f952405f2f856cea8fc205356b813c Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 21:53:17 +0530 Subject: [PATCH 05/12] Update dotnet.yml Added publish to nuget build step --- .github/workflows/dotnet.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e5c95d6aa..7737256cb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,4 +1,4 @@ -name: .NET +name: Build and Publish to Nuget on: push: @@ -23,3 +23,9 @@ jobs: run: dotnet build --no-restore - name: Test run: dotnet test --no-build --verbosity normal + - name: Publish + uses: brandedoutcast/publish-nuget@v2.5.2 + with: + PROJECT_FILE_PATH: Extensions/Extensions.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}} + From 4d741fe0ec7f79195223064fd16fe431994b2e0c Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 21:56:48 +0530 Subject: [PATCH 06/12] Update dotnet.yml Updated project file path --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7737256cb..0a30571b5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -26,6 +26,6 @@ jobs: - name: Publish uses: brandedoutcast/publish-nuget@v2.5.2 with: - PROJECT_FILE_PATH: Extensions/Extensions.csproj + PROJECT_FILE_PATH: websocket-sharp/websocket-sharp.csproj NUGET_KEY: ${{secrets.NUGET_API_KEY}} From 51680da8341408ee5b9bd4fcd57937e75ca502a3 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 22:04:52 +0530 Subject: [PATCH 07/12] Added version property in csproj --- websocket-sharp/websocket-sharp.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index 079bc2efa..9b87d5772 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -4,6 +4,7 @@ .net6.0 enable enable + 1.0.0.0 From 3b86b8ea3a3b9a394953675699f621d9f43591c9 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 22:23:51 +0530 Subject: [PATCH 08/12] Updated to .Net Standard 2.1 --- websocket-sharp/websocket-sharp.csproj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index 9b87d5772..989747276 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -1,10 +1,9 @@ - + - .net6.0 - enable + netstandard2.1 enable - 1.0.0.0 + 1.0.0.0 From 7163d968cfa5c0b25ae664c38b7e474d93609d6e Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 22:36:53 +0530 Subject: [PATCH 09/12] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0a30571b5..640d5825f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,5 +27,5 @@ jobs: uses: brandedoutcast/publish-nuget@v2.5.2 with: PROJECT_FILE_PATH: websocket-sharp/websocket-sharp.csproj - NUGET_KEY: ${{secrets.NUGET_API_KEY}} + NUGET_KEY: ${{ secrets.NUGET_API_KEY }} From 760dc2dcf8bf0efe862cdcb7fd3e30cf9eb7b1c3 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 22:59:16 +0530 Subject: [PATCH 10/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0de7cfc73..85d9f27f3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Welcome to websocket-sharp! # ## Important Notes ## -## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net 6.0. All example projects also updated to .Net 6.0. ## +## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net Standard 2.1. All example projects also updated to .Net 6.0. ## From 659def0cf5faf2950a28647c66c4f61eb2a8dd10 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 23:17:44 +0530 Subject: [PATCH 11/12] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85d9f27f3..b7ba5117d 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,12 @@ # Welcome to websocket-sharp! # ## Important Notes ## -## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net Standard 2.1. All example projects also updated to .Net 6.0. ## - - +## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net Standard 2.1 and published the nuget package. All example projects also updated to .Net 6.0. ## +## To install the package: ## +```Install-Package websocket-sharp-core-netstandard -Version 1.0.0``` + + websocket-sharp supports: - [RFC 6455](#supported-websocket-specifications) From b0987c8f24fdb8ec58096b722346ebb75419b425 Mon Sep 17 00:00:00 2001 From: suhel Date: Wed, 31 Aug 2022 23:52:07 +0530 Subject: [PATCH 12/12] Update README.md --- README.md | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index b7ba5117d..f4f27880e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ ## Important Notes ## ## Original repository is not updated to be used with .Net Core. There was a PR, but looks like it was not yet merged even after an year. I have created this fork and updated all references to .Net Standard 2.1 and published the nuget package. All example projects also updated to .Net 6.0. ## - -## To install the package: ## -```Install-Package websocket-sharp-core-netstandard -Version 1.0.0``` - websocket-sharp supports: @@ -20,12 +16,6 @@ websocket-sharp supports: - [Connecting through the HTTP proxy server](#connecting-through-the-http-proxy-server) - .NET Framework **3.5** or later (includes compatible environment such as [Mono]) -## Branches ## - -- [master] for production releases. -- [hybi-00] for older [draft-ietf-hybi-thewebsocketprotocol-00]. No longer maintained. -- [draft75] for even more old [draft-hixie-thewebsocketprotocol-75]. No longer maintained. - ## Build ## websocket-sharp is built as a single assembly, **websocket-sharp.dll**. @@ -34,40 +24,15 @@ websocket-sharp is developed with [MonoDevelop]. So a simple way to build is to ## Install ## -### Self Build ### - -You should add your websocket-sharp.dll (e.g. `/path/to/websocket-sharp/bin/Debug/websocket-sharp.dll`) to the library references of your project. - -If you would like to use that dll in your [Unity] project, you should add it to any folder of your project (e.g. `Assets/Plugins`) in the **Unity Editor**. - ### NuGet Gallery ### -websocket-sharp is available on the [NuGet Gallery], as still a **prerelease** version. +websocket-sharp is available on the [NuGet Gallery] -- [NuGet Gallery: websocket-sharp] +- [NuGet Gallery: websocket-sharp-core-netstandard] You can add websocket-sharp to your project with the NuGet Package Manager, by using the following command in the Package Manager Console. - PM> Install-Package WebSocketSharp -Pre - -### Unity Asset Store ### - -websocket-sharp is available on the Unity Asset Store (Sorry, Not available now). - -- [WebSocket-Sharp for Unity] - -It works with **Unity Free**, but there are some limitations: - -- [Security Sandbox of the Webplayer] (The server is not available in Web Player) -- [WebGL Networking] (Not available in WebGL) -- Incompatible platform (Not available for such UWP) -- Lack of dll for the System.IO.Compression (The compression extension is not available on Windows) -- .NET Socket Support for iOS/Android (iOS/Android Pro is required if your Unity is earlier than Unity 5) -- .NET API 2.0 compatibility level for iOS/Android - -.NET API 2.0 compatibility level for iOS/Android may require to fix lack of some features for later than .NET Framework 2.0, such as the `System.Func<...>` delegates (so i have added them in the asset package). - -And it is priced at **US$15**. I believe your $15 makes this project more better, **Thank you!** + PM> Install-Package websocket-sharp-core-netstandard -Version 1.0.0 ## Usage ##