GithubHelp home page GithubHelp logo

isabella232 / websockify-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from novnc/websockify-js

0.0 0.0 0.0 4.45 MB

JavaScript WebSocket to TCP bridge

License: Other

JavaScript 93.22% HTML 6.78%

websockify-js's Introduction

websockify-js: WebSockets support for any application/server

websockify was formerly named wsproxy and was part of the noVNC project.

At the most basic level, websockify just translates WebSockets traffic to normal socket traffic. Websockify accepts the WebSockets handshake, parses it, and then begins forwarding traffic between the client and the target in both directions.

Note that this is the JavaScript version of websockify. The primary project is the Python version of websockify.

To run websockify-js:

cd websockify
npm install
./websockify.js [options] SOURCE_ADDR:PORT TARGET_ADDR:PORT

News/help/contact

Notable commits, announcements and news are posted to @noVNC

If you are a websockify developer/integrator/user (or want to be) please join the noVNC/websockify discussion group

Bugs and feature requests can be submitted via github issues.

If you want to show appreciation for websockify you could donate to a great non-profits such as: Compassion International, SIL, Habitat for Humanity, Electronic Frontier Foundation, Against Malaria Foundation, Nothing But Nets, etc. Please tweet @noVNC if you do.

Encrypted WebSocket connections (wss://)

To encrypt the traffic using the WebSocket 'wss://' URI scheme you need to generate a certificate and key for Websockify to load. The --cert=CERT and --key=KEY options are used to specify the file name for the certificate and key. You can generate a self-signed certificate using openssl. When asked for the common name, use the hostname of the server where the proxy will be running:

openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem

For a self-signed certificate to work, you need to make your client/browser understand it. You can do this by installing it as accepted certificate, or by using that same certificate for a HTTPS connection to which you navigate first and approve. Browsers generally don't give you the "trust certificate?" prompt by opening a WSS socket with invalid certificate, hence you need to have it acccept it by either of those two methods.

If you have a commercial/valid SSL certificate with one or more intermediate certificates, concat them into one file, server certificate first, then the intermediate(s) from the CA, etc. Point to this file with the --cert option and then also to the key with --key.

Websock Javascript library

The include/websock.js Javascript library provides a Websock object that is similar to the standard WebSocket object but Websock enables communication with raw TCP sockets (i.e. the binary stream) via websockify.

Websock has built-in receive queue buffering; the message event does not contain actual data but is simply a notification that there is new data available. Several rQ* methods are available to read binary data off of the receive queue.

The Websock API is documented on the websock.js API wiki page.

websockify-js's People

Contributors

alonbl avatar andersk avatar aricstewart avatar cendioossman avatar chrislee35 avatar crodjer avatar darkpixel avatar directxman12 avatar dosaboy avatar edschouten avatar hyask avatar josedpedroso avatar kanaka avatar kosmasgiannis avatar leeyiw avatar libricoleur avatar nevon avatar ossman avatar pesintta avatar rafaelfolco avatar rpodgorny avatar samfrances avatar samhed avatar snorkeyg avatar stevschmid avatar thekvn avatar thomasgoirand avatar timkurvers avatar tomob avatar vishvananda 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.