feat(wetsock) basic web socket server setup
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
@@ -7,7 +7,7 @@ const server = Bun.serve({
|
|||||||
port: process.env.APP_PORT || 43_069,
|
port: process.env.APP_PORT || 43_069,
|
||||||
fetch(req, server) {
|
fetch(req, server) {
|
||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
if(url.pathname == '/chat') return wetsock.handleFetch(req, server);
|
if(url.pathname == '/chat') return wetsock.handleUpgrade(req, server);
|
||||||
|
|
||||||
if(url.pathname == '/client.js') {
|
if(url.pathname == '/client.js') {
|
||||||
const filePath = resolve(__dirname, 'WetSock', 'Client', 'Client.js');
|
const filePath = resolve(__dirname, 'WetSock', 'Client', 'Client.js');
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>WetSock Client Test</title>
|
<title>WetSock Client Test</title>
|
||||||
<script src="/wetsock-client.js"></script>
|
|
||||||
<style>
|
<style>
|
||||||
/* Add some basic styling */
|
/* Add some basic styling */
|
||||||
body {
|
body {
|
||||||
@@ -52,8 +51,9 @@
|
|||||||
<h2>Output:</h2>
|
<h2>Output:</h2>
|
||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
|
|
||||||
<script>
|
<script type="module">
|
||||||
const client = new WetSockClient('ws://wetsock.ghosted.id:80/chat');
|
import WetSockClient from './client.js';
|
||||||
|
const client = new WetSockClient('wss://wetsock.ghosted.id:443/chat');
|
||||||
const pluginIdentifierSelect = document.getElementById('pluginIdentifier');
|
const pluginIdentifierSelect = document.getElementById('pluginIdentifier');
|
||||||
const actionNameSelect = document.getElementById('actionName');
|
const actionNameSelect = document.getElementById('actionName');
|
||||||
const entityIdInput = document.getElementById('entityId');
|
const entityIdInput = document.getElementById('entityId');
|
||||||
|
|||||||
Reference in New Issue
Block a user