GithubHelp home page GithubHelp logo

websocket-server-laravel's Introduction

Welcome

This project is made for

Creating a simple websocket serevr so you can send and recieve messages via the ws library in nodejs without having to use pusher or use events

Why didn't you use pusher or websocket by beyondcode

the reason being that i simply want a simple websocket server easy to setup and easy to use without the need of actually setting up a full websocket server, which means i can use this simple websocket to connect to lets say: a discord bot, another website, python process.

How do i set it up for my own project:

  1. Download all files in this repo
  2. Put everything in the following structure: *: WebsocketMan.php in app folder *: WebsocketServer Folder in the app folder
  3. open composer.json for your laravel project put this inside "autoload" key: *: , "files": [ "app/WebsocketMan.php" ]
  4. save the composer.json file and run this command: composer dump-autoload
  5. put this in your ENV file:
WEBSOCKET_LOOKOUT_PORT=3000
WEBSOCKET_LOOKOUT=localhost
WEBSOCKET_PORT=6001

ENV Variables Definition:

WEBSOCKET_LOOKOUT_PORT the port which the express.js server will run in WEBSOCKET_LOOKOUT the host which the express.js server will run in WEBSOCKET_PORT the port which the websocket server will run in

How do i run it?:

  1. open the terminal and go to app/WebsockerServer
  2. enter this command: node main.js
  3. change the env variables
  4. call this function to get the data from the websocket client: websocketcall("INFO"), it might return: NO_FEEDBACK(the client did not submit data on time or did not submit at all) or return the feedback of the client

websocket-server-laravel's People

Contributors

soldevelop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.