All Projects → tg123 → websockify-nginx-module

tg123 / websockify-nginx-module

Licence: MIT license
Embed websockify into Nginx (convert any tcp connection into websocket)

Programming Languages

c
50402 projects - #5 most used programming language
perl
6916 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to websockify-nginx-module

Websockify
Websockify is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service.
Stars: ✭ 2,942 (+2128.79%)
Mutual labels:  novnc, websockify, websocket-proxy
Novnc
VNC client web application
Stars: ✭ 8,269 (+6164.39%)
Mutual labels:  novnc, websockify
CrownLabs
Kubernetes-based Remote Laboratories
Stars: ✭ 96 (-27.27%)
Mutual labels:  novnc
Docker Android
Android in docker solution with noVNC supported and video recording
Stars: ✭ 4,042 (+2962.12%)
Mutual labels:  novnc
kali-desktop
🐳 Kali Linux desktop running in Docker on any operating system, in your web browser or a VNC client, with Kali top10 tools pre-installed.
Stars: ✭ 72 (-45.45%)
Mutual labels:  novnc
ubuntu-vnc-xfce
Headless Ubuntu/Xfce containers with VNC/noVNC (Generation 1)
Stars: ✭ 51 (-61.36%)
Mutual labels:  novnc
iCtrl
UofT Engineering Lab Remote
Stars: ✭ 91 (-31.06%)
Mutual labels:  novnc
dockerfile-dwarffortress
Dwarf Fortress in a container
Stars: ✭ 21 (-84.09%)
Mutual labels:  novnc
ubuntu-vnc-xfce-chromium
Retired. Headless Ubuntu/Xfce container with VNC/noVNC and Chromium (Generation 1)
Stars: ✭ 20 (-84.85%)
Mutual labels:  novnc
docker-novnc
tigervnc, websokify, novnc and Nginx with s6-overlay in a docker image.
Stars: ✭ 31 (-76.52%)
Mutual labels:  novnc
ubuntu-vnc-xfce-g3
Headless Ubuntu/Xfce containers with VNC/noVNC (Generation 3)
Stars: ✭ 83 (-37.12%)
Mutual labels:  novnc
ubuntu-vnc-xfce-firefox
Retired. Headless Ubuntu/Xfce containers with VNC/noVNC and Firefox (Generation 1)
Stars: ✭ 20 (-84.85%)
Mutual labels:  novnc
easy-novnc
Single-binary noVNC instance, web UI, and multi-host proxy.
Stars: ✭ 142 (+7.58%)
Mutual labels:  novnc
pojde
Develop from any device with a browser.
Stars: ✭ 60 (-54.55%)
Mutual labels:  novnc
soulseek-docker
🐳 Soulseek Over noVNC Docker Container
Stars: ✭ 149 (+12.88%)
Mutual labels:  novnc
ubuntu-desktop-jp
日本人向けのUbuntuデスクトップ環境のDockerイメージです。
Stars: ✭ 62 (-53.03%)
Mutual labels:  novnc
Goproxy
🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
Stars: ✭ 11,334 (+8486.36%)
Mutual labels:  websocket-proxy
amiws
Asterisk Management Interface (AMI) to Web-socket proxy
Stars: ✭ 60 (-54.55%)
Mutual labels:  websocket-proxy
cnn-proxy
Subdomain method that proxies websockets, XMLHttpRequests, and more.
Stars: ✭ 13 (-90.15%)
Mutual labels:  websocket-proxy
alloy
A web proxy for use in combating web filters.
Stars: ✭ 74 (-43.94%)
Mutual labels:  websocket-proxy

Websockify port for Nginx

Embed the Websockify into Nginx

Installation

git clone https://github.com/tg123/websockify-nginx-module.git

cd path/to/nginx_source

./configure --add-module=/path/to/websockify-nginx-module/

make
make install

Uasge

Single noVNC websockify proxy

in your nginx.conf

location /websockify {
    websockify_pass yourvncip:port
}
  1. visit http://kanaka.github.io/noVNC/noVNC/vnc.html in your browser,
  2. Host is your nginx server's ip
  3. port is your nginx server's listening port
  4. Click connect

Quick start with Docker

Proxy 192.168.188.42:5901 to your localhost/websockify.

Note: 5901 is hardcoded in nginx.vh.default.conf

docker run -d --add-host vnchost:192.168.188.42 -p 80:80 farmer1992/nginx-websockify

Dynamic vnc upstream with help of ngx-lua

an example script read ip and port from url params and verify them by md5

SECURITY VULNERABILITY WARNING

this is only an exmaple for you to understand how to work together with ngx-lua do NOT use this script in production.

anyone who know your private key can connect any machine behind your nginx proxy, you should restrict target ip and port in a whitelist.

in your nginx.conf

location /websockify {

    set $vnc_addr '';
    access_by_lua '

        -- your private key here
        local key = "CHANGE_ME_!!!!"
        
        -- read from url params
        local args = ngx.req.get_uri_args()
        local ip = args["ip"] or "127.0.0.1"
        local port = args["port"] or  "5900"
        local sign = args["sign"]
        local t = tonumber(args["t"]) or 0
        local elapse = ngx.time() - t

        -- make sure the signature are generated within 30 seconds
        if elapse > 30 or elapse < 0  then
            ngx.exit(ngx.HTTP_FORBIDDEN)
        end

        local addr = ip .. ":" .. port

        -- verify the signature
        if ngx.md5(key .. t .. addr .. key) ~= sign then
            ngx.exit(ngx.HTTP_FORBIDDEN)
        end

        ngx.var.vnc_addr = addr
    ';

    websockify_pass $vnc_addr;
}

use ajax call to vnc_url.php to retrieve the websockify url, then let noVNC connect to it.

<?php

// query you vnc ip and port from somewhere, e.g. mysql.
//

// query result
$addr = '127.0.0.1';
$port = 5900;

// same as private key in nginx.conf
$key = "CHANGE_ME_!!!!";

$t = time();

echo '/websockify/?' . http_build_query(array(
    't' =>  $t,
    'sign' => md5($key . $t . "$addr:$port" . $key),
    'ip' => $addr,
    'port' => $port,
));

Directives

  • websockify_buffer_size: Default: 65543 = 65535 + 4 + 4 (websocket max frame size + header + mask)

    The buffer size used to store the encode/decode data. each websockify connection will cost websockify_buffer_size * 2 ( 1 upstream + 1 downstream ) addational memory

  • websockify_read_timeout: Default 60s

    proxy_read_timeout of websockify upstream

  • websockify_connect_timeout: Default 60s

    proxy_connect_timeout of websockify upstream

  • websockify_send_timeout: Default 60s

    proxy_send_timeout of websockify upstream

Nginx Compatibility

  • v0.02 - v0.0.3

    • 1.7.x (Tested on 1.7.9)
    • 1.6.x (Tested on 1.6.2)
  • v0.0.1

    • 1.5.x (Tested on 1.5.9)
    • 1.4.x (Tested on 1.4.4)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].