Giter Club home page Giter Club logo

neoswebservers's Introduction

Neos Web Servers

A NeosModLoader mod for Neos VR

This mod implements an HTTP web server and a Websockets server into the Neos client. This can be used to serve local copy of web apps rather than relying on a third party host and removes the need for a hosted websocket server. This mod is largely targeted at developers who are interested in ensuring the backends for their web-enabled objects in-world can stand the test of time. Eventually domains go offline and free web hosts go down. The web server serves content from a Webserver folder in the NeosVR installation root. This folder will need to be created manually. There are also four websocket endpoints to enable a variety of different application needs.

Installation

  1. Install NeosModLoader.
  2. Install NeosModSettings.
  3. Place Webservers.dll into your nml_mods folder. This folder should be at C:\Program Files (x86)\Steam\steamapps\common\NeosVR\nml_mods for a default install. You can create it if it's missing, or if you launch the game once with NeosModLoader installed it will create the folder for you.
  4. Place EmbedIO.dll, and Swan.Lite.dll into your nml_libs folder. This folder should be at C:\Program Files (x86)\Steam\steamapps\common\NeosVR\nml_mods for a default install. It should have been created as part of the NeosModLoader installation.
  5. Start the game. If you want to verify that the mod is working you can check your Neos logs.

Web Server

When the Neos client is started the web server will begin hosting any content in the Webserver folder in the NeosVR root folder.

This folder should be at C:\Program Files (x86)\Steam\steamapps\common\NeosVR\Webserver for a default install. You will need to create the folder and add any content you want served.

The server can be accessed by navigating to http://localhost:8080/

Websocket Server

There are four websocket endpoints, each behaving slightly differently to enable a wide range of applications.

Echo Server

This is a simple echo server that will repeat back any messages it receives to the sender.

This endpoint can be accessed by connecting your websocket client to ws://localhost:8080/echo

Chat Server

This endpoint is intended to act as a shared messaging bus. Any message sent to it will broadcast to all other connected clients. The sender does not receive a copy of the sent message.

This endpoint can be accessed by connecting your websocket client to ws://localhost:8080/chat

Chat Echo Server

This endpoint is identical to the Chat Server endpoint, except it sends the input back to the receiver in addition to broadcasting to all connected clients.

This endpoint can be accessed by connecting your websocket client to ws://localhost:8080/chat-echo

Chat ID Server

This endpoint is similar to the Chat Server, except each client is assigned a unique identifier which is valid for the duration of the websocket connection.

This allows you to distinguish between different connected clients to enable more of a direct messaging system.

All clients will receive a connected and disconnected message whenever a client opens or closes a connection. The connected message is sent to the connecting client as well.

Each message is prefixed with the connection ID separated by a pipe operator ( | ) for easy parsing.

Example:

3CqoZKBIWUyjmSITygRFZw|connected (Received on connection and broadcast to all other clients)
3CqoZKBIWUyjmSITygRFZw|Some example data (Received in reply to sending data and broadcast to all other clients)
o5MkHrV34k+5LfY6Q4zHag|I saw your data! (Received in reply to sending data and broadcast to all other clients)

This endpoint can be accessed by connecting your websocket client to ws://localhost:8080/chat-id

neoswebservers's People

Contributors

zetaphor 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.