Giter Site home page Giter Site logo

Enable WebSockets support about droidvnc-ng HOT 9 OPEN

bk138 avatar bk138 commented on July 23, 2024 1
Enable WebSockets support

from droidvnc-ng.

Comments (9)

bk138 avatar bk138 commented on July 23, 2024 2

There's a project called noVNC. You can try it.

I know it and worked with it. It's a client. I was htinking about LibVNCServer here.

from droidvnc-ng.

wozuo avatar wozuo commented on July 23, 2024 2

@bk138 thanks for the quick reply, yea I implemented it using the example described in the LibVNCServer readme. No worries I'll let you know if I find something to get it to work!

from droidvnc-ng.

Yonle avatar Yonle commented on July 23, 2024

There's a project called noVNC. You can try it.

from droidvnc-ng.

Yonle avatar Yonle commented on July 23, 2024

For Alternative way, Convert TCP into WS, Because noVNC Websockify is doing that.

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

LibVNCServer has native WebSockets support, so this issue here should be easy to tackle.

from droidvnc-ng.

Yonle avatar Yonle commented on July 23, 2024

Ah yes! You're right!

from droidvnc-ng.

wozuo avatar wozuo commented on July 23, 2024

Hi @bk138 any progress on this? I'm trying to implement the websockets support using LibVNCServer but the HTTP connections are not reaching the HTTP server somehow... (the VNC server over TCP works though)
So what I've tried so far is copying the contents of the webclients dir from the assets folder to external storage /storage/emulated/0/webclients on startup of the app (just for testing). And in droidvnc-ng.c I'm setting:

theScreen->alwaysShared = TRUE;
theScreen->httpDir = "/storage/emulated/0/webclients";
theScreen->httpEnableProxyConnect = TRUE;
theScreen->httpPort = 8080;
theScreen->http6Port = 8080;

and after rbInitServer(theScreen) I'm checking the sockets:

if(theScreen->httpListenSock == RFB_INVALID_SOCKET || theScreen->httpListen6Sock == RFB_INVALID_SOCKET) {
        __android_log_print(ANDROID_LOG_ERROR, TAG, "vncStartServer: httpListenSock failed starting (%s)", strerror(errno));
        Java_net_christianbeier_droidvnc_1ng_MainService_vncStopServer(env, thiz);
        return JNI_FALSE;
    }

The console prints:

 Listening for HTTP connections on TCP port 8080
      URL http://localhost:8080
    Listening for HTTP connections on TCP6 port 8080
      URL http://localhost:8080
    vncStartServer: successfully started

as if everything is running fine, but if I try to connect to http://ipofmyphone:8080 via the browser the requests seem to not even reach the app (no log output, etc. it just loads forever). Any ideas?

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

I can at for the time being only point you at https://github.com/LibVNC/libvncserver#using-websockets for a working WebSockets example, I won't be able to spend time on this here issue in the upcoming weeks.

from droidvnc-ng.

Scisaga avatar Scisaga commented on July 23, 2024
  1. update libvncserver code according to LibVNC/libvncserver#492, re make & run app in your phone,
  2. try to connect http://ipofmyphone:5900/ with novnc, 5900 is default vnc port, you may found remote window in your browser,
  3. i guess libvncserver implemented some port multiplexing mechanism.

from droidvnc-ng.

Related Issues (20)

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.