Skip to content

Feature/http2 #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e2e7471
just starting
ademar Apr 30, 2016
59b5673
parse data and headers frames
ademar May 2, 2016
a41be41
remaining frame parsers
ademar May 6, 2016
df2edec
amend FramePayload
ademar May 6, 2016
4b01ad4
encode/decode frame header unit test
ademar May 7, 2016
ab49a70
unit test pass
ademar May 8, 2016
ee061e6
Hpack and Huffman
ademar Oct 9, 2016
57d86cd
re-order files
ademar Oct 12, 2016
876daf4
blocking queue
ademar Oct 17, 2016
9419b8f
update fsproj
ademar Oct 17, 2016
6a5978d
decode
ademar Oct 17, 2016
841c522
prototyping http2 connection
ademar Oct 17, 2016
c177809
http2 client for unit testing
ademar Oct 17, 2016
41878b6
paket.lock
ademar Oct 17, 2016
7855079
convert ConnectionFacade functions to methods
ademar Oct 17, 2016
a84321f
correct maxN value
ademar Oct 17, 2016
fff4b19
decoding headers
ademar Oct 19, 2016
2d80e6f
bug fixing huffman encoding
ademar Oct 20, 2016
58afd89
unit test huffman encoding/decoding
ademar Oct 20, 2016
3b7a0ed
fix decode headers
ademar Oct 21, 2016
0178722
write header
ademar Oct 21, 2016
234d936
connection handling
ademar Oct 21, 2016
4ce1e85
else
ademar Oct 22, 2016
b6273b7
stream identifier int32
ademar Oct 22, 2016
140e9df
disable test (HttpTwo is broken)
ademar Oct 22, 2016
edf3322
rebase
ademar Oct 22, 2016
a5c7dd4
fix build
ademar Oct 22, 2016
42d5066
fix freya example
ademar Oct 22, 2016
460137a
fix dotliquit example
ademar Oct 22, 2016
5baba0a
update freya example
ademar Oct 23, 2016
4846b5c
these require different target version
ademar Oct 23, 2016
e2f130f
bug fix: there are other valid identifiers i.e websocket
ademar Oct 23, 2016
d0192ac
update project.json
ademar Oct 23, 2016
c63ec72
fix typo
ademar Oct 23, 2016
2e91f79
correct path separator
ademar Oct 23, 2016
cb9355c
no GetBuffer in dotnetcore
ademar Oct 23, 2016
6442a60
refactor function in two, fix warning
ademar Oct 23, 2016
ca9376a
clean a bit
ademar Oct 23, 2016
8f7745e
fixes
ademar Oct 28, 2016
0da062a
makes internal buffer accessible
ademar Oct 28, 2016
c21024b
Hpack.decode test
ademar Oct 28, 2016
0533f53
more work
ademar Nov 3, 2016
8120ab3
encode header unit test (wip)
ademar Nov 3, 2016
f512dd5
Fix a few endianness bugs
rmunn Jan 19, 2017
b5280f8
Merge pull request #567 from rmunn/feature/http2
ademar Jan 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ PLATFORMS

DEPENDENCIES
albacore (~> 2.3)

BUNDLED WITH
1.12.5
152 changes: 68 additions & 84 deletions examples/Freya/Freya.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<OutputType>Exe</OutputType>
<RootNamespace>Freya</RootNamespace>
<AssemblyName>Freya</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -31,16 +32,6 @@
<PlatformTarget>
</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup>
Expand All @@ -54,20 +45,8 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<ProjectReference Include="..\..\src\Suave\Suave.fsproj">
<Project>{3DC9193E-BD0C-4486-9C58-56B630C36623}</Project>
<Name>Suave</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<Content Include="App.config" />
</ItemGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Aether">
<HintPath>..\..\packages\examples\Aether\lib\net35\Aether.dll</HintPath>
Expand All @@ -78,188 +57,177 @@
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Arachne.Core">
<HintPath>..\..\packages\examples\Arachne.Core\lib\net40\Arachne.Core.dll</HintPath>
<Reference Include="Anat">
<HintPath>..\..\packages\examples\Anat\lib\net35\Anat.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Arachne.Http">
<HintPath>..\..\packages\examples\Arachne.Http\lib\net40\Arachne.Http.dll</HintPath>
<Reference Include="Hephaestus">
<HintPath>..\..\packages\examples\Hephaestus\lib\net452\Hephaestus.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Arachne.Http.Cors">
<HintPath>..\..\packages\examples\Arachne.Http.Cors\lib\net40\Arachne.Http.Cors.dll</HintPath>
<Reference Include="FParsec">
<HintPath>..\..\packages\examples\FParsec\lib\net40-client\FParsec.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="Arachne.Language">
<HintPath>..\..\packages\examples\Arachne.Language\lib\net40\Arachne.Language.dll</HintPath>
<Reference Include="FParsecCS">
<HintPath>..\..\packages\examples\FParsec\lib\net40-client\FParsecCS.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Arachne.Uri">
<HintPath>..\..\packages\examples\Arachne.Uri\lib\net40\Arachne.Uri.dll</HintPath>
<Reference Include="Freya.Core">
<HintPath>..\..\packages\examples\Freya.Core\lib\net452\Freya.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Arachne.Uri.Template">
<HintPath>..\..\packages\examples\Arachne.Uri.Template\lib\net40\Arachne.Uri.Template.dll</HintPath>
<Reference Include="Freya.Machines">
<HintPath>..\..\packages\examples\Freya.Machines\lib\net452\Freya.Machines.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="FParsec">
<HintPath>..\..\packages\examples\FParsec\lib\net40-client\FParsec.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="FParsecCS">
<HintPath>..\..\packages\examples\FParsec\lib\net40-client\FParsecCS.dll</HintPath>
<Reference Include="Freya.Machines">
<HintPath>..\..\packages\examples\Freya.Types\lib\net452\Freya.Types.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Core">
<HintPath>..\..\packages\examples\Freya.Core\lib\net45\Freya.Core.dll</HintPath>
<Reference Include="Freya.Machines.Http">
<HintPath>..\..\packages\examples\Freya.Machines.Http\lib\net452\Freya.Machines.Http.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Lenses.Http">
<HintPath>..\..\packages\examples\Freya.Lenses.Http\lib\net45\Freya.Lenses.Http.dll</HintPath>
<Reference Include="Freya.Routers">
<HintPath>..\..\packages\examples\Freya.Routers\lib\net452\Freya.Routers.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Lenses.Http.Cors">
<HintPath>..\..\packages\examples\Freya.Lenses.Http.Cors\lib\net45\Freya.Lenses.Http.Cors.dll</HintPath>
<Reference Include="Freya.Types.Routers.Template">
<HintPath>..\..\packages\examples\Freya.Routers.Uri.Template\lib\net452\Freya.Routers.Uri.Template.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Machine">
<HintPath>..\..\packages\examples\Freya.Machine\lib\net45\Freya.Machine.dll</HintPath>
<Reference Include="Freya.Optics.Http">
<HintPath>..\..\packages\examples\Freya.Optics.Http\lib\net452\Freya.Optics.Http.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Machine.Extensions.Http">
<HintPath>..\..\packages\examples\Freya.Machine.Extensions.Http\lib\net45\Freya.Machine.Extensions.Http.dll</HintPath>
<Reference Include="Freya.Polyfills">
<HintPath>..\..\packages\examples\Freya.Polyfills\lib\net452\Freya.Polyfills.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Machine.Extensions.Http.Cors">
<HintPath>..\..\packages\examples\Freya.Machine.Extensions.Http.Cors\lib\net45\Freya.Machine.Extensions.Http.Cors.dll</HintPath>
<Reference Include="Freya.Types.Http">
<HintPath>..\..\packages\examples\Freya.Types.Http\lib\net452\Freya.Types.Http.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Machine.Router">
<HintPath>..\..\packages\examples\Freya.Machine.Router\lib\net45\Freya.Machine.Router.dll</HintPath>
<Reference Include="Freya.Types.Language">
<HintPath>..\..\packages\examples\Freya.Types.Language\lib\net452\Freya.Types.Language.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Recorder">
<HintPath>..\..\packages\examples\Freya.Recorder\lib\net45\Freya.Recorder.dll</HintPath>
<Reference Include="Freya.Types.Uri">
<HintPath>..\..\packages\examples\Freya.Types.Uri\lib\net452\Freya.Types.Uri.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Freya.Router">
<HintPath>..\..\packages\examples\Freya.Router\lib\net45\Freya.Router.dll</HintPath>
<Reference Include="Freya.Types.Uri.Template">
<HintPath>..\..\packages\examples\Freya.Types.Uri.Template\lib\net452\Freya.Types.Uri.Template.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\examples\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
Expand All @@ -270,7 +238,7 @@
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
<ItemGroup>
<Reference Include="Hekate">
<HintPath>..\..\packages\examples\Hekate\lib\net35\Hekate.dll</HintPath>
Expand All @@ -280,4 +248,20 @@
</ItemGroup>
</When>
</Choose>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Program.fs" />
<None Include="paket.references" />
<Content Include="App.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<ProjectReference Include="..\..\src\Suave\Suave.fsproj">
<Project>{3DC9193E-BD0C-4486-9C58-56B630C36623}</Project>
<Name>Suave</Name>
</ProjectReference>
</ItemGroup>
</Project>
51 changes: 17 additions & 34 deletions examples/Freya/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,31 @@

module SampleApp =
open System.Text
open Arachne.Language
open Arachne.Http
open Freya.Core
open Freya.Core.Operators
open Freya.Lenses.Http
open Freya.Machine
open Freya.Machine.Extensions.Http
open Freya.Machine.Router
open Freya.Router
open Arachne.Uri.Template
open Freya.Machines.Http
open Freya.Routers.Uri.Template

let en = LanguageTag.parse "en"
let name =
freya {
let! name = Freya.Optic.get (Route.atom_ "name")

let inline represent (x : string) =
{ Description =
{ Charset = Some Charset.Utf8
Encodings = None
MediaType = Some MediaType.Text
Languages = Some [ en ] }
Data = Encoding.UTF8.GetBytes x }
match name with
| Some name -> return name
| _ -> return "World" }

let ok =
Freya.Optic.set Response.reasonPhrase_ (Some "Hey Folks!")
*> Freya.init (represent "Hey, folks!")
let hello =
freya {
let! name = name

let common =
freyaMachine {
using http
charsetsSupported Charset.Utf8
languagesSupported en
mediaTypesSupported MediaType.Text }
return Represent.text (sprintf "Hello %s!" name) }

let home =
let machine =
freyaMachine {
using http
including common
methodsSupported GET
handleOk ok }
handleOk hello }

let routes =
let router =
freyaRouter {
resource "/" home }
resource "/hello{/name}" machine }

module SelfHostedServer =
open Freya.Core
Expand All @@ -58,7 +41,7 @@ module SelfHostedServer =
printfn "w00t"

let app =
OwinApp.ofAppFunc "/" (OwinAppFunc.ofFreya routes)
OwinApp.ofAppFunc "/" (OwinAppFunc.ofFreya router)

let config =
{ defaultConfig with
Expand Down
Loading