kraftfahrstrasse TypeScript实现的WAMP客户端

TypeScript 写的 WAMP 客户端你见过吗?kraftfahrstrasse就是这么挺的库,用起来还蛮舒服的。全程类型安全,浏览器和 Node 端通吃,兼顾开发体验和代码可维护性。

kraftfahrstrasse 的最大特点是全靠 TypeScript 驱动,啥意思?就是你写 WAMP 协议的时候,类型提示全都有,调用方法的时候一点也不慌。尤其在多人协作时,少踩坑,写起来也安心。

库用的是ES6 标准,没转 ES5,作者说得直接:不支持老浏览器,也没打算支持。所以如果你还要兼容 IE,那就不太适合了。换句话说,现代项目用它正合适,打包小,运行快。

依赖也精简,像是msgpack5ws,只挑重要的用,包大小压得比较紧。你要是用 Webpack 的话,ES6 模块还能配合 Tree Shaking,挺省资源的。

需要注意的是:kraftfahrstrasse 不是那种“一下就能上手”的封装库,适合对 WAMP 有点了解的同学。如果你对 ES6 还不熟,建议先看看es6 入门这类资源打个底。

如果你正在搞分布式通信、实时系统,或者需要用 WAMP 打通多个客户端,那 kraftfahrstrasse 值得一试。现代语法、类型安全、轻量实现,配上你的项目架构,刚刚好。

zip
kraftfahrstrasse-master.zip 预估大小:55个文件
folder
kraftfahrstrasse-master 文件夹
file
.travis.yml 139B
folder
example 文件夹
file
tlsClientAuthentication.ts 665B
file
resumeToken.ts 863B
file
index.ts 3KB
file
package.json 2KB
file
tslint.json 522B
file
tsconfig.module.json 260B
file
LICENSE 1KB
file
package-lock.json 203KB
folder
src 文件夹
folder
auth 文件夹
file
TLS.ts 723B
file
Anonymous.ts 545B
file
TransportProvider.ts 1KB
file
Ticket.ts 2KB
file
Cookie.ts 461B
folder
generic 文件夹
file
Publisher.ts 3KB
file
StateMachine.ts 661B
file
MessageProcessor.ts 1KB
file
Caller.ts 4KB
file
Subscriber.ts 7KB
file
ConnectionStateMachine.ts 2KB
file
Connection.ts 12KB
file
WampError.ts 608B
file
Callee.ts 10KB
folder
serialize 文件夹
file
NodeMSGPack.ts 761B
file
JSON.ts 446B
file
msgpack.d.ts 41B
file
BrowserMSGPack.ts 1KB
folder
transport 文件夹
file
NodeWebSocketTransport.ts 762B
file
BrowserWebSocketTransport.ts 514B
file
SerializationError.ts 125B
file
WebSocketTransport.ts 3KB
folder
logging 文件夹
file
Logger.ts 776B
folder
types 文件夹
file
Protocol.ts 2KB
folder
messages 文件夹
file
HelloMessage.ts 334B
file
RegisterMessage.ts 898B
file
SubscribeMessage.ts 978B
file
WelcomeMessage.ts 373B
file
MessageTypes.ts 664B
file
CallMessage.ts 1KB
file
PublishMessage.ts 680B
file
Serializer.ts 628B
file
Connection.ts 3KB
file
Transport.ts 818B
file
AuthProvider.ts 2KB
folder
util 文件夹
file
deferred.ts 438B
file
id.ts 438B
file
map.ts 2KB
file
index.ts 1KB
file
tsconfig.json 20B
file
tsconfig.base.json 405B
file
tsconfig.example.json 199B
file
.gitignore 970B
file
README.md 11KB
file
.editorconfig 283B
file
tsconfig.cjs.json 171B
zip 文件大小:86.96KB