SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
293 stars 91 forks source link

socketCluster client on the backend #133

Closed mlmarius closed 5 years ago

mlmarius commented 5 years ago

Hi. New to node so sorry if asking a silly question but I'm trying to make a simple backend app that connects to socketcluster using the following code:

const socketCluster = import('socketcluster-client')

const options = {
    hostname: 'localhost',
    secure: false,
    port: 9000,
    rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate
};
// Initiate the connection to the server
const socket = socketCluster.create(options)

then I attempt to run it using npm index.js And the error I get is

TypeError: socketCluster.create is not a function

Can you give some pointers on how to get this running ?