-
Notifications
You must be signed in to change notification settings - Fork 0
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
17 changed files
with
267 additions
and
361 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
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
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,25 +1,51 @@ | ||
import "../../mod/mod.ts"; | ||
Deno.test({ name: "Server startup/close" }, async () => { | ||
const server = new WebTransportServer(4433, { | ||
certFile: "./certs/cert.pem", | ||
keyFile: "./certs/key.pem", | ||
maxTimeout: 10, | ||
keepAlive: 3, | ||
}); | ||
// import { join } from "https://deno.land/[email protected]/path/mod.ts"; | ||
// import { GenerateCertKeyFile } from "../../mod/crypto.ts"; | ||
// import "../../mod/mod.ts"; | ||
// import { assert } from "https://deno.land/[email protected]/assert/assert.ts"; | ||
|
||
await server.close(); | ||
}); | ||
// //add certs cleanup methods after tests | ||
// const certPath = join(Deno.cwd(), "./certs/"); | ||
// Deno.test({ name: "Server startup/close" }, () => { | ||
// //generate a certificate | ||
// const [cert, key] = GenerateCertKeyFile( | ||
// "localhost", | ||
// 0, | ||
// 10, | ||
// undefined, | ||
// "cert.pem", | ||
// "key.pem", | ||
// ); | ||
// const server = new WebTransportServer(4433, { | ||
// certFile: cert, | ||
// keyFile: key, | ||
// maxTimeout: 10, | ||
// keepAlive: 3, | ||
// }); | ||
// server.close(); | ||
// //try to start a UDP socket on the same port to see if it's closed | ||
// const sock = Deno.listenDatagram({ | ||
// hostname: "0.0.0.0", | ||
// port: 4433, | ||
// transport: "udp", | ||
// }); | ||
// assert(sock, "Server did not close"); | ||
// sock.close(); | ||
// }); | ||
|
||
// Deno.test( | ||
// { name: "Server with generated certificate startup/close" }, | ||
// async () => { | ||
// const server = new WebTransportServer(4434, { | ||
// maxTimeout: 10, | ||
// keepAlive: 3, | ||
// notAfter: 10, | ||
// notBefore: 0, | ||
// domain: "localhost", | ||
// }); | ||
// await server.close(); | ||
// }, | ||
// ); | ||
// // Deno.test( | ||
// // { name: "Server with generated certificate startup/close" }, | ||
// // () => { | ||
// // const server = new WebTransportServer(4433, { | ||
// // maxTimeout: 10, | ||
// // keepAlive: 3, | ||
// // notAfter: 10, | ||
// // notBefore: 0, | ||
// // domain: "localhost", | ||
// // }); | ||
// // server.close(); | ||
// // }, | ||
// // ); | ||
|
||
// Deno.test({ name: "Server Cleanup certs" }, () => { | ||
// Deno.removeSync(certPath, { recursive: true }); | ||
// }); |
Oops, something went wrong.