-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
standardize method, data, and headers (metadata) Bring API closer to HTTP
- Loading branch information
Universal Web
committed
Jun 28, 2023
1 parent
8e273ad
commit e0a43a4
Showing
9 changed files
with
173 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { construct, UniqID } from '@universalweb/acid'; | ||
import { actions } from './server/actions/index.js'; | ||
class UDSP { | ||
constructor() { | ||
return this.initialize(); | ||
} | ||
async initialize() { | ||
} | ||
gracePeriod = 30000; | ||
maxPacketSize = 1328; | ||
connectionIdSize = 8; | ||
actions = construct(Map); | ||
stateCodeDescriptions = ['initializing', 'initialized', 'failed to initialize']; | ||
state = 0; | ||
/* | ||
* A puzzle used to challenge clients to ensure authenticity, connection liveliness, and congestion control. | ||
* Slow down account creation. | ||
* Generate crypto currency or compute work. | ||
*/ | ||
puzzleFlag = false; | ||
/* | ||
* IPv6 preferred. | ||
*/ | ||
ipVersion = 'udp6'; | ||
events = construct(Map); | ||
streamIdGenerator = construct(UniqID); | ||
} |
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
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,16 @@ | ||
export function buildMessage({ | ||
method, | ||
contentType, | ||
dataSize, | ||
packet | ||
}) { | ||
if (contentType) { | ||
packet.head.contentType = contentType; | ||
} | ||
if (dataSize) { | ||
packet.head.dataSize = dataSize; | ||
} | ||
if (method) { | ||
packet.method = method; | ||
} | ||
} |
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