Closed moonformeli closed 3 years ago
try importing from wocket
instead, as we changed the name, and wocket
will be the module we update from now on:
import { Server } from "https://deno.land/x/wocket@v0.6.2/mod.ts"
@ebebbington
Thanks, I don't see any errors now with importing wocket
, but I don't see any console log either
wss.run({
hostname: '127.0.0.1',
port: 8081,
});
console.log(`Server started on ws://${wss.hostname}:${wss.port}`);
Oh, I solved the problem! The socket has to be opened before the web server is opened Thank you for helping me :)
I wonder if I can use this package in my React app
I’m guessing you have a ws and http server running in the same file? Would you mind sharing the contents of that file? I’m just curious if you encountered a bug
and also no problem :) in relation to using it in your react application - you ‘could’, in the sense that Wocket would be your websocket server, then you can use the WebSocket API or https://github.com/drashland/socket-client to connect to it
Going to close this issue then
Summary
What is your question?
Run
Result
This is a very simple example app in Deno. But I faced that error when I tried to use this package. What am I supposed to do to fix this?
typescript version: 4.1.3 deno version: 1.6.0