diff --git a/AsyncHttp.sln b/AsyncHttp.sln new file mode 100644 index 0000000..f8c9c26 --- /dev/null +++ b/AsyncHttp.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.452 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncHttp", "AsyncHttp\AsyncHttp.csproj", "{819551D6-5FE4-4D46-99DD-BB199467C028}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleApp", "ExampleApp\ExampleApp.csproj", "{23F76A95-7F56-4137-9F7F-5EAB26B9FC8E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {819551D6-5FE4-4D46-99DD-BB199467C028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {819551D6-5FE4-4D46-99DD-BB199467C028}.Debug|Any CPU.Build.0 = Debug|Any CPU + {819551D6-5FE4-4D46-99DD-BB199467C028}.Release|Any CPU.ActiveCfg = Release|Any CPU + {819551D6-5FE4-4D46-99DD-BB199467C028}.Release|Any CPU.Build.0 = Release|Any CPU + {23F76A95-7F56-4137-9F7F-5EAB26B9FC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23F76A95-7F56-4137-9F7F-5EAB26B9FC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23F76A95-7F56-4137-9F7F-5EAB26B9FC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23F76A95-7F56-4137-9F7F-5EAB26B9FC8E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A96B9E4B-14C3-4D0B-8FF2-07F8A2788722} + EndGlobalSection +EndGlobal diff --git a/App.config b/AsyncHttp/App.config similarity index 100% rename from App.config rename to AsyncHttp/App.config diff --git a/AsyncHttp.csproj b/AsyncHttp/AsyncHttp.csproj similarity index 100% rename from AsyncHttp.csproj rename to AsyncHttp/AsyncHttp.csproj diff --git a/Enums.cs b/AsyncHttp/Enums.cs similarity index 100% rename from Enums.cs rename to AsyncHttp/Enums.cs diff --git a/IPath.cs b/AsyncHttp/IPath.cs similarity index 100% rename from IPath.cs rename to AsyncHttp/IPath.cs diff --git a/MimeTypes.cs b/AsyncHttp/MimeTypes.cs similarity index 100% rename from MimeTypes.cs rename to AsyncHttp/MimeTypes.cs diff --git a/NotFoundPath.cs b/AsyncHttp/NotFoundPath.cs similarity index 100% rename from NotFoundPath.cs rename to AsyncHttp/NotFoundPath.cs diff --git a/Properties/AssemblyInfo.cs b/AsyncHttp/Properties/AssemblyInfo.cs similarity index 100% rename from Properties/AssemblyInfo.cs rename to AsyncHttp/Properties/AssemblyInfo.cs diff --git a/Request.cs b/AsyncHttp/Request.cs similarity index 100% rename from Request.cs rename to AsyncHttp/Request.cs diff --git a/Response.cs b/AsyncHttp/Response.cs similarity index 100% rename from Response.cs rename to AsyncHttp/Response.cs diff --git a/Server.cs b/AsyncHttp/Server.cs similarity index 100% rename from Server.cs rename to AsyncHttp/Server.cs diff --git a/ServerPath.cs b/AsyncHttp/ServerPath.cs similarity index 100% rename from ServerPath.cs rename to AsyncHttp/ServerPath.cs diff --git a/ExampleApp/.gitignore b/ExampleApp/.gitignore new file mode 100644 index 0000000..0a754a1 --- /dev/null +++ b/ExampleApp/.gitignore @@ -0,0 +1,345 @@ +# Created by https://www.gitignore.io/api/visualstudio +# Edit at https://www.gitignore.io/?templates=visualstudio + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# End of https://www.gitignore.io/api/visualstudio \ No newline at end of file diff --git a/ExampleApp/App.config b/ExampleApp/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/ExampleApp/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ExampleApp/ExampleApp.csproj b/ExampleApp/ExampleApp.csproj new file mode 100644 index 0000000..775bb07 --- /dev/null +++ b/ExampleApp/ExampleApp.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {23F76A95-7F56-4137-9F7F-5EAB26B9FC8E} + Exe + ExampleApp + ExampleApp + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {819551d6-5fe4-4d46-99dd-bb199467c028} + AsyncHttp + + + + \ No newline at end of file diff --git a/ExampleApp/Program.cs b/ExampleApp/Program.cs new file mode 100644 index 0000000..4c5824f --- /dev/null +++ b/ExampleApp/Program.cs @@ -0,0 +1,31 @@ +using AsyncHttp; +using System.IO; +using System.Text; + +namespace ExampleApp +{ + class Program + { + [ServerPath(Method.GET, "/")] + public class IndexPath : IPath + { + public override void HandleRequest(Request request) + { + Response.Body = Encoding.UTF8.GetBytes("Hello Async World"); + } + } + + static void Main(string[] args) + { + Server server = new Server(); + //server.CertificatePath = "cert.pfx"; + //server.CertificatePassword = "1234"; + server.StartAsync(); + + while (true) + { + // do whatever you want in the meanwhile + } + } + } +} diff --git a/ExampleApp/Properties/AssemblyInfo.cs b/ExampleApp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d122cb6 --- /dev/null +++ b/ExampleApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +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("ExampleApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ExampleApp")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[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("23f76a95-7f56-4137-9f7f-5eab26b9fc8e")] + +// 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")]