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,
|
||||
fetch(req, server) {
|
||||
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') {
|
||||
const filePath = resolve(__dirname, 'WetSock', 'Client', 'Client.js');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WetSock Client Test</title>
|
||||
<script src="/wetsock-client.js"></script>
|
||||
<style>
|
||||
/* Add some basic styling */
|
||||
body {
|
||||
@@ -52,8 +51,9 @@
|
||||
<h2>Output:</h2>
|
||||
<div id="output"></div>
|
||||
|
||||
<script>
|
||||
const client = new WetSockClient('ws://wetsock.ghosted.id:80/chat');
|
||||
<script type="module">
|
||||
import WetSockClient from './client.js';
|
||||
const client = new WetSockClient('wss://wetsock.ghosted.id:443/chat');
|
||||
const pluginIdentifierSelect = document.getElementById('pluginIdentifier');
|
||||
const actionNameSelect = document.getElementById('actionName');
|
||||
const entityIdInput = document.getElementById('entityId');
|
||||
|
||||
Reference in New Issue
Block a user