Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WebSocketServer.Payload.AuthMessage

Alex Ander edited this page Apr 14, 2018 · 1 revision
interface AuthMessage {
    Message?: string;
    Status?: AuthStatusCode;
    UserName: string;
}
enum AuthStatusCode { ERROR, SUCCESS }
// client -> server
ws.send(JSON.stringify({
	Type: "AUTH_MESSAGE",
	Payload: {
		Token: "0d788151ccfb3c0"
	}
}));
// [success] server -> client
{
	Type: "AUTH_MESSAGE",
	Payload: {
		Message: "SUCCESS",
		UsersList: ["loktionov129", "Scorpio92"]
	}
}
// [error] server -> client
{
	Type: "AUTH_MESSAGE",
	Payload: {
		Message: "ERROR.ALREADY_CONNECTED"
	}
}
// [error] server -> client
{
	Type: "AUTH_MESSAGE",
	Payload: {
		Message: "ERROR.NOT_FOUND"
	}
}

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.