added stuff

master
Julie 5 years ago
parent 06fc05ee04
commit f1b7a6de0f

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/.idea.websocket-sharp.iml
/contentModel.xml
/projectSettingsUpdater.xml
/modules.xml
# Datasource local storage ignored files
/../../../../../../../../:\Users\cover\RiderProjects\websocket-sharp\.idea\.idea.websocket-sharp\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/TestServer2" vcs="Git" />
</component>
</project>

@ -49,6 +49,10 @@
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a"> <Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
<Package>notify-sharp</Package> <Package>notify-sharp</Package>
@ -68,4 +72,7 @@
<Compile Include="Notifier.cs" /> <Compile Include="Notifier.cs" />
<Compile Include="NotificationMessage.cs" /> <Compile Include="NotificationMessage.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

@ -49,14 +49,15 @@
<DefineConstants>UBUNTU</DefineConstants> <DefineConstants>UBUNTU</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a"> <Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
<Private>False</Private> <Private>False</Private>
<Package>notify-sharp</Package> <Package>notify-sharp</Package>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AssemblyInfo.cs" /> <Compile Include="AssemblyInfo.cs" />
@ -74,4 +75,7 @@
<Name>websocket-sharp</Name> <Name>websocket-sharp</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

@ -48,6 +48,10 @@
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
</ItemGroup> </ItemGroup>
@ -66,5 +70,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

@ -48,6 +48,10 @@
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
</ItemGroup> </ItemGroup>
@ -66,6 +70,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" />
<None Include="Public\index.html" /> <None Include="Public\index.html" />
<None Include="Public\Js\echotest.js" /> <None Include="Public\Js\echotest.js" />
</ItemGroup> </ItemGroup>

@ -18,7 +18,7 @@ namespace Example3
// create a new instance with the 'secure' parameter set to true, // create a new instance with the 'secure' parameter set to true,
// or an https scheme HTTP URL. // or an https scheme HTTP URL.
var httpsv = new HttpServer (4649); var httpsv = new HttpServer (12346);
//var httpsv = new HttpServer (5963, true); //var httpsv = new HttpServer (5963, true);
//var httpsv = new HttpServer (System.Net.IPAddress.Any, 4649); //var httpsv = new HttpServer (System.Net.IPAddress.Any, 4649);

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

@ -0,0 +1,12 @@
using System;
namespace TestServer
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="CertFilePassword" value="password"/>
<add key="DocumentRootPath" value="../../Public"/>
<add key="ServerCertFile" value="/path/to/cert.pfx"/>
</appSettings>
</configuration>

@ -0,0 +1,66 @@
using System;
using System.Configuration;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using WebSocketSharp;
using WebSocketSharp.Net;
using WebSocketSharp.Server;
namespace TestServer2
{
internal class Program
{
public static void Main(string[] args)
{
var httpsv = new HttpServer ("http://localhost:12346");
// ConfigurationManager
// Set the document root path.
httpsv.DocumentRootPath = ConfigurationManager.AppSettings["DocumentRootPath"];
// Set the HTTP GET request event.
httpsv.OnGet += (sender, e) => {
var req = e.Request;
var res = e.Response;
var path = req.RawUrl;
if (path == "/")
path += "index.html";
byte[] contents;
if (!e.TryReadFile (path, out contents)) {
res.StatusCode = (int) HttpStatusCode.NotFound;
return;
}
if (path.EndsWith (".html")) {
res.ContentType = "text/html";
res.ContentEncoding = Encoding.UTF8;
}
else if (path.EndsWith (".js")) {
res.ContentType = "application/javascript";
res.ContentEncoding = Encoding.UTF8;
}
res.ContentLength64 = contents.LongLength;
res.Close (contents, true);
};
// Handle endpoints
httpsv.AddWebSocketService<Test> ("/Test");
// Everything else
httpsv.Start ();
if (httpsv.IsListening) {
Console.WriteLine ("Listening on port {0}, and providing WebSocket services:", httpsv.Port);
foreach (var path in httpsv.WebSocketServices.Paths)
Console.WriteLine ("- {0}", path);
}
Console.WriteLine ("\nPress Enter key to stop the server...");
Console.ReadLine ();
httpsv.Stop ();
}
}
}

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestServer2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestServer2")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("874E9D0F-A2D7-4714-B790-F9631ED35582")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,68 @@
/*
* echotest.js
*
* Derived from Echo Test of WebSocket.org (http://www.websocket.org/echo.html).
*
* Copyright (c) 2012 Kaazing Corporation.
*/
var url = "ws://localhost:4649/Echo";
//var url = "wss://localhost:5963/Echo";
var output;
function init () {
output = document.getElementById ("output");
doWebSocket ();
}
function doWebSocket () {
websocket = new WebSocket (url);
websocket.onopen = function (e) {
onOpen (e);
};
websocket.onmessage = function (e) {
onMessage (e);
};
websocket.onerror = function (e) {
onError (e);
};
websocket.onclose = function (e) {
onClose (e);
};
}
function onOpen (event) {
writeToScreen ("CONNECTED");
send ("WebSocket rocks");
}
function onMessage (event) {
writeToScreen ('<span style="color: blue;">RESPONSE: ' + event.data + '</span>');
websocket.close ();
}
function onError (event) {
writeToScreen ('<span style="color: red;">ERROR: ' + event.data + '</span>');
}
function onClose (event) {
writeToScreen ("DISCONNECTED");
}
function send (message) {
writeToScreen ("SENT: " + message);
websocket.send (message);
}
function writeToScreen (message) {
var pre = document.createElement ("p");
pre.style.wordWrap = "break-word";
pre.innerHTML = message;
output.appendChild (pre);
}
window.addEventListener ("load", init, false);

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>WebSocket Echo Test</title>
<script type="text/javascript" src="/Js/echotest.js">
</script>
</head>
<body>
<h2>WebSocket Echo Test</h2>
<div id="output"></div>
</body>
</html>

@ -0,0 +1,24 @@
using System;
using System.Threading;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace TestServer2
{
public class Test : WebSocketBehavior
{
protected override void OnOpen()
{
Console.WriteLine("Conection Opened");
Send("AAAAAAAAAA");
}
protected override void OnMessage(MessageEventArgs e)
{
Console.WriteLine(e.Data);
Console.WriteLine("Message Recieved");
Send("AAAAAAAAAA");
}
}
}

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{874E9D0F-A2D7-4714-B790-F9631ED35582}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestServer2</RootNamespace>
<AssemblyName>TestServer2</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Test.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\websocket-sharp\websocket-sharp.csproj">
<Project>{b357bac7-529e-4d81-a0d2-71041b19c8de}</Project>
<Name>websocket-sharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Public\index.html" />
<None Include="Public\Js\echotest.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

Binary file not shown.

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example2", "Example2\Exampl
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3", "Example3\Example3.csproj", "{C648BA25-77E5-4A40-A97F-D0AA37B9FB26}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3", "Example3\Example3.csproj", "{C648BA25-77E5-4A40-A97F-D0AA37B9FB26}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer2", "TestServer2\TestServer2.csproj", "{874E9D0F-A2D7-4714-B790-F9631ED35582}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -59,6 +61,14 @@ Global
{C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU {C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU
{C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release|Any CPU.ActiveCfg = Release|Any CPU {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 {C648BA25-77E5-4A40-A97F-D0AA37B9FB26}.Release|Any CPU.Build.0 = Release|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Release|Any CPU.Build.0 = Release|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Release_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{874E9D0F-A2D7-4714-B790-F9631ED35582}.Release_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = websocket-sharp\websocket-sharp.csproj StartupItem = websocket-sharp\websocket-sharp.csproj

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

@ -49,13 +49,15 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause> <ConsolePause>false</ConsolePause>
<GenerateDocumentation>true</GenerateDocumentation> <GenerateDocumentation>true</GenerateDocumentation>
<CustomCommands> <!-- <CustomCommands>-->
<CustomCommands> <!-- <Command type="AfterBuild" command="doc/doc.sh" workingdir="doc/" externalConsole="true" />-->
<Command type="AfterBuild" command="doc/doc.sh" workingdir="doc/" externalConsole="true" /> <!-- </CustomCommands>-->
</CustomCommands>
</CustomCommands>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
@ -146,4 +148,7 @@
<Folder Include="Net\" /> <Folder Include="Net\" />
<Folder Include="Net\WebSockets\" /> <Folder Include="Net\WebSockets\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>
Loading…
Cancel
Save