Skip to content

Commit

Permalink
Create a bogus version 0.2.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejpedzich committed Dec 13, 2021
1 parent 046e830 commit 07f4f8d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules\\typescript\\lib",
"deepscan.enable": true
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.3

- This is a bogus release only to test if package publishing still works

## 0.2.2

- Fix broken `AuthPersonalCredentials` import
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parsec-sdk",
"version": "0.2.2",
"version": "0.2.3",
"description": "UNOFFICIAL and WIP JavaScript/TypeScript SDK for Parsec remote desktop.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
36 changes: 36 additions & 0 deletions src/classes/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export class Client {

public peerID?: string;

private webrtcPeerConnection?: RTCPeerConnection;

private websocket!: WebSocket;

/**
* Authenticate client using the _personal_ strategy
*
Expand Down Expand Up @@ -89,4 +93,36 @@ export class Client {
throw new Error(httpErrorBody?.error || (error as Error).message);
}
}
/**
* @param {{htmlVideo:HTMLVideoElement;htmlAudio:HTMLAudioElement;secret?:string;}} config
*/
public async connect(config: {
htmlVideo: HTMLVideoElement;
htmlAudio: HTMLAudioElement;
secret?: string;
}) {
if (!this.sessionID) {
throw new AuthRequiredError();
}

this.websocket = new WebSocket(
`wss://kessel-ws.parsecgaming.com:443/?session_id=${this.sessionID}&role=client&version=1&sdk_version=0`
);

this.websocket.onclose;

this.webrtcPeerConnection = new RTCPeerConnection({
iceServers: [{ urls: 'stun:stun.parsec.gg:3478' }]
});

this.webrtcPeerConnection.onicecandidate = ({ candidate }) => {
const iceCandidateData = candidate?.candidate
?.replace('candidate:', '')
.split(' ');

if (iceCandidateData && iceCandidateData.length >= 8) {
const protocol = iceCandidateData[2].toLowerCase();
}
};
}
}

0 comments on commit 07f4f8d

Please sign in to comment.