Skip to content

Commit

Permalink
Bump protocol version to draft-04
Browse files Browse the repository at this point in the history
  • Loading branch information
englishm committed Jul 25, 2024
1 parent f1ed65f commit 6cd52c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transport/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ export class Client {
const setup = new Setup.Stream(reader, writer)

// Send the setup message.
await setup.send.client({ versions: [Setup.Version.DRAFT_03], role: this.config.role })
await setup.send.client({ versions: [Setup.Version.DRAFT_04], role: this.config.role })

// Receive the setup message.
// TODO verify the SETUP response.
const server = await setup.recv.server()

if (server.version != Setup.Version.DRAFT_03) {
if (server.version != Setup.Version.DRAFT_04) {
throw new Error(`unsupported server version: ${server.version}`)
}

Expand Down
1 change: 1 addition & 0 deletions lib/transport/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Version {
DRAFT_01 = 0xff000001,
DRAFT_02 = 0xff000002,
DRAFT_03 = 0xff000003,
DRAFT_04 = 0xff000004,
KIXEL_00 = 0xbad00,
KIXEL_01 = 0xbad01,
}
Expand Down

0 comments on commit 6cd52c6

Please sign in to comment.