Skip to content

Carbon-Standards/Client

Repository files navigation

Client

A library to easily interact with PSocket servers from the client.

Creating a client

import { PSocketClient } from "@psocket/client";

const client = new PSocketClient({
  url: "/psocket/"
});

Making remote requests

const response: Response = await client.fetch("https://api.example.com/");

console.log(await response.json());

Connecting to a remote

const ws: WebSocket = await client.connect("wss://example.com/");

ws.onopen = () => {
  ws.send("Hello World!");
}

About

A library to easily interact with Carbon servers from the client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published