Connecting Neos to Other Applications

From Neos Wiki
Revision as of 03:40, 26 April 2021 by Aesc (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Other languages:
English • ‎日本語 • ‎한국어

When creating items and worlds within Neos, you may want to connect Neos to the outside world. To applications, software and systems that are outside of it. This guide will provide some information on how you can achieve that.

Example Scenarios

Some example things you might want to do this with are:

  • Communicating with Web Servers
  • Talking to Real world Hardware or devices such as Heart Rate Sensors, Lights or Sound Equipment
  • Receiving data such as stock information, the weather and more

Options

You have a number of options to achieve communication with other applications. With all of these options do remember that Neos does not support JSON or Collections/Arrays so you will have to handle parsing these yourself within LogiX.

Webserver Communication using HTTP

Neos has two nodes that can allow you to make HTTP Requests:

You can use these to communicate with any HTTP capable webserver, API or system.

Web Socket Communication

Neos has WebSocket capabilities. These allow Neos to communicate with any WebSocket capable server. This is useful for real time communication between Neos and an Application.

Sending other Protocols over WebSockets

While Neos only supports HTTP and WebSockets you can send messages over WebSockets which resemble or contain messages in other protocols. Users have done this with:

  • DMX
  • MIDI
  • OSC

Using a WebSocket / HTTP Proxy

You can also use WebSockets or HTTP as a proxy to communicate to another device. Users have done this with:

  • Heart Rate Sensors
  • Calendars
  • Complex APIs that needed simplifying

Using Plugins

Neos has Plugins which allow you to write custom functionality into Neos. This functionality can be vast and varied as you have full implementation control in C#. When you use plugins you will be isolated from the rest of the Neos Community as they will only be able to join your sessions if they have the same Plugins installed. Please see the plugin page for more information.

Security / Consent

Always consider Security, talking to outside systems can open up all sorts of security issues. At this time anything involving Payments, Passwords or personal information is not recommended.

Additionally, outside connections via HTTP and WebSockets are controlled by a User's Consent, They can block and allow access to specific domain names and servers. Always use the Is Host Access Allowed and Request Host Access Nodes to check if a User has blocked a connection and to request access to a host. When requesting access, please specify a logical reason.

If a user has blocked access, try to make your systems gracefully fail with a clear message about what is going on.

Recommendations

When deciding what to do here, it's entirely up to you but some recommendations are presented here to assist you in making a decision.

  • Only use WebSockets if you need real time communication - WebSockets have extra overhead for both servers and clients/Neos users. If you just need to make requests and receive responses consider HTTP instead.
  • Ensure that you're running the requests / connections from the right users. Connections need to be made from a user. For example when you make a request a single user is in charge of running that request. Make sure this is the correct user and that you're not running requests for more than one user.