Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
_build | ||
.merlin | ||
.mirage.config | ||
config/ | ||
key_gen.ml | ||
main.ml | ||
main.native | ||
Makefile | ||
mirage-unikernel-*.install | ||
mirage-unikernel-*.opam | ||
myocamlbuild.ml | ||
vxrrks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(executable | ||
(public_name vxrrks) | ||
(name main) | ||
(modules unikernel main key_gen) | ||
(libraries | ||
vxrrks_server | ||
cohttp-mirage | ||
functoria-runtime | ||
mirage-bootvar-unix | ||
mirage-clock-unix | ||
mirage-conduit | ||
mirage-logs | ||
mirage-runtime | ||
mirage-types-lwt | ||
mirage-unix | ||
nocrypto.lwt | ||
tcpip.stack-socket)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(lang dune 1.11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name vxrrks_server) | ||
(libraries lwt cohttp-lwt) | ||
(preprocess (pps lwt_ppx))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module type SERVER = Cohttp_lwt.S.Server | ||
|
||
module Make (Cohttp_server : SERVER) = struct | ||
let make () = | ||
let callback _conn _req _body = | ||
let%lwt res, body = | ||
Cohttp_server.respond_string ~status:`OK ~body:"ayy" () | ||
in | ||
Lwt.return @@ `Response (res, body) | ||
in | ||
let conn_closed _ = () in | ||
Cohttp_server.make_response_action ~callback ~conn_closed () | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
module T = Mirage_types_lwt | ||
module type HTTP = Cohttp_lwt.S.Server | ||
|
||
module Main (Time : T.TIME) = struct | ||
let start _time = | ||
let rec loop () = | ||
Logs.info (fun f -> f "soap"); | ||
Time.sleep_ns (Duration.of_sec 1);%lwt | ||
loop () | ||
in | ||
loop () | ||
module Main (Http : HTTP) = struct | ||
module Server = Vxrrks_server.Server.Make(Http) | ||
|
||
let start http = | ||
let tcp = `TCP 8080 in | ||
http tcp @@ Server.make () | ||
end |