Giter Site home page Giter Site logo

xwebsockets's Introduction

XWebSockets

UDP ⇆ WebSockets translator for X-Plane

Features:

  • Static asset server
  • Simple, JSON-based communication

Currently supported operations:

  • CMND
  • RREF
  • DREF

Installation

Prerequisites: Node.js, NPM

Clone the repository, open up your shell and navigate to the repo folder. Run npm i to install dependencies and node start to compile and start the server.

Settings

Settings are changed via xws_config.txt.

Name Description Example
XWS_PORT The port to serve on 8080
XWS_STATIC The directory to serve static assets from ./dist
XWS_ENV Change from debug to prod to prevent logging requests debug

Commands

To actuate a command, send the following JSON:

{
    "header": "CMND",
    "path": "sim/autopilot/heading_sync"
}

Datarefs

To set a dataref, send the following JSON:

{
    "header": "DREF",
    "path": "sim/cockpit/radios/transponder_code",
    "data": 1200
}

To subscribe to dataref updates, send the following JSON:

{
    "header": "RREF",
    "freq": 5,
    "index": 101,
    "path": "sim/cockpit/autopilot/heading_mag"
}

freq times per second, you'll receive the following JSON:

{
    "header": "RREF",
    "data": [
        [101, 212.366]
    ]
}

X-Plane is smart and can batch datarefs over UDP, and XWebSockets matches that behavior. Returned JSON could look like:

{
    "header": "RREF",
    "data": [
        [101, 212.366],
        [102, 1200],
        [103, 129100]
    ]
}

xwebsockets's People

Contributors

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