yarn build
This commit is contained in:
parent
7b718de77c
commit
a1b8886b26
1 changed files with 90 additions and 54 deletions
10
dist/client/websocket.js
generated
vendored
10
dist/client/websocket.js
generated
vendored
|
|
@ -4,9 +4,15 @@ const SUBPROTOCOL = "mcp";
|
|||
* Client transport for WebSocket: this will connect to a server over the WebSocket protocol.
|
||||
*/
|
||||
export class WebSocketClientTransport {
|
||||
connect(url) {
|
||||
constructor(url) {
|
||||
this._url = url;
|
||||
}
|
||||
start() {
|
||||
if (this._socket) {
|
||||
throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
this._socket = new WebSocket(url, SUBPROTOCOL);
|
||||
this._socket = new WebSocket(this._url, SUBPROTOCOL);
|
||||
this._socket.onerror = (event) => {
|
||||
var _a;
|
||||
const error = "error" in event
|
||||
|
|
|
|||
Loading…
Reference in a new issue