Giter Club home page Giter Club logo

Comments (26)

gdan101 avatar gdan101 commented on May 18, 2024 4

@sonicnkt: I managed to create an exe (from the Node.js version) so you don't need to install Node.js and the components.
These are the steps (I never used Node.js before, so I am pretty sure there is a shorter solution):

  1. Install NodeJS (the default global installation path is: %AppData%\npm, %AppData%\npm-cache)

  2. Install required components, run:

    • npm install -g express
    • npm install -g optimist
    • npm install -g policyfile
    • npm install -g ws
    • npm install -g http-server
    • npm install -g mime-types
    • npm install -g pkg
  3. Create a folder named "websockify" under "%AppData%\npm\node_modules" and copy the contents of folder "websockify\other\js" in it.

  4. Run (documentation of arguments -> https://www.npmjs.com/package/pkg): pkg "%AppData%\npm\node_modules\websockify\websockify.js" --targets "latest-win-x86,latest-win-x64" --out-path "your output folder"

from websockify.

samhed avatar samhed commented on May 18, 2024 1

That works well for me too. Tested on Windows 10 and with noVNC + TigerVNC Windows server.

from websockify.

kanaka avatar kanaka commented on May 18, 2024

@doriwal I notice you closed the issue. Does that mean you figured it out?

from websockify.

doriwal avatar doriwal commented on May 18, 2024

No its an open issue
On 2013 2 18 00:34, "Joel Martin" [email protected] wrote:

@doriwal https://github.com/doriwal I notice you closed the issue. Does
that mean you figured it out?


Reply to this email directly or view it on GitHubhttps://github.com//issues/67#issuecomment-13698686.

from websockify.

doriwal avatar doriwal commented on May 18, 2024

I reopened the issue as it wasnt solved

from websockify.

doriwal avatar doriwal commented on May 18, 2024

looks like my local novnc is working ,
I just run the tests like http://localhost:6080/tests/base64.html

and the response is

onload
PASS: 'window.btoa("hello world")' returned expected 'aGVsbG8gd29ybGQ='
PASS: 'window.btoa("a")' returned expected 'YQ=='
PASS: 'window.btoa("ab")' returned expected 'YWI='
PASS: 'window.btoa("abc")' returned expected 'YWJj'
PASS: 'window.btoa("abcd")' returned expected 'YWJjZA=='
PASS: 'window.btoa("abcde")' returned expected 'YWJjZGU='
PASS: 'window.btoa("abcdef")' returned expected 'YWJjZGVm'
PASS: 'window.btoa("abcdefg")' returned expected 'YWJjZGVmZw=='
PASS: 'window.btoa("abcdefgh")' returned expected 'YWJjZGVmZ2g='
PASS: 'window.atob("aGVsbG8gd29ybGQ=")' returned expected 'hello world'
PASS: 'Base64_decode("aGVsbG8gd29ybGQ=")' returned expected 'hello world'
PASS: 'window.atob("YQ==")' returned expected 'a'
PASS: 'Base64_decode("YQ==")' returned expected 'a'
PASS: 'window.atob("YWI=")' returned expected 'ab'
PASS: 'Base64_decode("YWI=")' returned expected 'ab'
PASS: 'window.atob("YWJj")' returned expected 'abc'
PASS: 'Base64_decode("YWJj")' returned expected 'abc'
PASS: 'window.atob("YWJjZA==")' returned expected 'abcd'
PASS: 'Base64_decode("YWJjZA==")' returned expected 'abcd'
PASS: 'window.atob("YWJjZGU=")' returned expected 'abcde'
PASS: 'Base64_decode("YWJjZGU=")' returned expected 'abcde'
PASS: 'window.atob("YWJjZGVm")' returned expected 'abcdef'
PASS: 'Base64_decode("YWJjZGVm")' returned expected 'abcdef'
PASS: 'typeof window.btoa' returned expected 'function'
PASS: 'window.btoa("")' returned expected ''
PASS: 'window.btoa(null)' returned expected ''
PASS: 'window.atob(window.btoa(window))' returned expected '[object Window]'
PASS: 'window.btoa("\u0080\u0081")' returned expected 'gIE='
Tests failed: 0
Tests passed: 28

So I guess that i did installed novnc locally ,

I dont know why
http://localhost:6080/vnc_auto.html?host=localhost&port=5901&true_color=1
or
http://localhost:6080/vnc_auto.html?host=localhost&port=6080&true_color=1

returned "noVNC ready: native WebSockets, canvas rendering" and after 2 seconds i get "Connect timeout"

from websockify.

smithkl42 avatar smithkl42 commented on May 18, 2024

I was having the same issue with the websockify.exe that came with noVNC.

I'm not sure if it's the same problem, but when I tried to run the websocketproxy.py file directly with Python 2.7, I get this error:

WARNING: no 'resource' module, daemonizing is slower or disabled
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 374, in main
    self = load(from_parent)
  File "C:\Python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\Python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Python27\lib\pickle.py", line 1133, in load_reduce
    value = func(*args)
  File "C:\Python27\lib\multiprocessing\reduction.py", line 193, in rebuild_socket
    _sock = fromfd(fd, family, type_, proto)
  File "C:\Python27\lib\multiprocessing\reduction.py", line 182, in fromfd
    s = socket.fromfd(fd, family, type_, proto)
AttributeError: 'module' object has no attribute 'fromfd'

Apparently that's because socket.fromfd isn't implemented on Python 2.x for Windows: http://bugs.python.org/issue1378.

When I try to run websockify with Python 3.3, I get a different error message:

  1: handler exception: Cannot serialize socket object
WARNING: no 'resource' module, daemonizing is slower or disabled
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python33\lib\multiprocessing\forking.py", line 344, in main
    self = load(from_parent)
EOFError

from websockify.

DirectXMan12 avatar DirectXMan12 commented on May 18, 2024

@doriwal , @smithkl42 : are you still experiencing this issue?

from websockify.

smithkl42 avatar smithkl42 commented on May 18, 2024

I was able to get websockify running on Windows if I used Python 3.2. Neither 2.7 nor 3.3 seem to have the necessary support for pseudo-forking processes on Windows. I haven't tried it with any other versions.

from websockify.

DirectXMan12 avatar DirectXMan12 commented on May 18, 2024

@smithkl42 : it would appear that Python pickles and then unpickles the Process in order to do a fork, and something in websockify isn't pickleable. It's strange, though, that it works on 3.2 and not 3.3. Can you get a more extended stack trace for Python 3.3? I think it's at least worth trying to fix the issue for Python 3.3+ if we can.

from websockify.

smithkl42 avatar smithkl42 commented on May 18, 2024

I agree that it'd be worth fixing. I'm not a Python coder, so I'm not sure how to get a more detailed stack trace - that's just what shows up on my console when I try to run it under Python 3.3. Any suggestions?

from websockify.

DirectXMan12 avatar DirectXMan12 commented on May 18, 2024

Whoops, didn't mean to close this. Must have clicked the wrong button.
Bah! Python 3.3 just out and out refuses to serialize sockets:
from /usr/lib64/python3.3/socket.py:

    def __getstate__(self):
        raise TypeError("Cannot serialize socket object")

While Python 3.2 doesn't specify a __getstate__ method at all. Were you able to confirm that things actually worked properly under Python 3.2? I can't see the Python devs arbitrarily disabling pickling of sockets in Python 3.3 unless there was actually something wrong with the way things worked in 3.2...

from websockify.

smithkl42 avatar smithkl42 commented on May 18, 2024

Yeah, 3.2 is working fine for me. I haven't tested it under load, but under the limited load I've thrown at it, it's been working just fine. Whatever serialization problems there might be, I suspect they must be of the sort that (for whatever reason) aren't affecting websockify.

from websockify.

kabilraj1979 avatar kabilraj1979 commented on May 18, 2024

@kanaka : I am trying to run the websockify on Windows 2012 R2 Standard (64 bit).
I have installed Python 2.7.11 version.
Installed compatible 64 bit versions of "py2exe" and "numpy".
Went through all of the issues mentioned for running novnc on Windows (especially #108 and #233)

Issue : When I try to connect via the web url (http://localhost/vnc.html?host=localhost&port=6080), I am getting handler exception : "can't pickle thread.lock objects"
"Import error: No module named run" from the forking.py

Please suggest a resolution. I get a feeling that there has not been robust successful running experience of this tool in Windows. Please let me know if it is not intended to run on Windows. Or am I missing something from my side? Appreciate your response

image

from websockify.

kanaka avatar kanaka commented on May 18, 2024

@kabilraj1979 websockify does not work on Windows using python 2.X. There has been some success using python 3.X. However, the node.js version of websockify apparently (I don't have a Windows system to test with) works pretty well on Windows so I suggest you use the node.js version if it that is an option for you.

from websockify.

kabilraj1979 avatar kabilraj1979 commented on May 18, 2024

@kanaka : Thanks for the response. The websockify.js allowed me to connect. Thanks. Need to explore what code is there in the web content. The js file was more or less doing the send and receive part of the web socket connection (kind of a reverse proxy)?

from websockify.

sonicnkt avatar sonicnkt commented on May 18, 2024

Is there a way to build the nodejs version in a simple script/exe version that is easy to deploy?
I saw the Powershell script here: https://github.com/aberbegall/novnc-launch-powershell/blob/master/README.md
But it has a lot of dependencies (installing full nodejs, then download additional packages etc), so there is no way to easily deploy this for me on multiple clients.
My goal was to put together a free, open and independent remote solution that wont rely on any additional servers.

from websockify.

kabilraj1979 avatar kabilraj1979 commented on May 18, 2024

@kanaka: Every time I have to proxy to a VNC server, I need to have different instances of the websockify.js. Is there a way to run it as a listener that can allow multiple connections on the fly? WebSocketConnections can be opened from one instance of the websockify.js on the fly right?

from websockify.

kanaka avatar kanaka commented on May 18, 2024

@kabilraj1979 multiple clients can connect to the same instance of websockify.js at the same time. However, you need to have one instance of websockify.js per target that you want to connect to. The python version of websockify supports target plugins which allow the target to be selected by an opaque token provided by the client. However, this functionality has not been ported to the websockify.js yet.

from websockify.

CendioOssman avatar CendioOssman commented on May 18, 2024

I tested the SIGCHLD thing, but as you've noticed there are a lot of issues remaining with multiprocessing. For now I've put an active block in the code so it refuses to start on Windows. Should make our handling of issues a bit smoother at least.

from websockify.

mliudev avatar mliudev commented on May 18, 2024

@gdan101 Could you tell me what version of node you had when you got this to run? I'm running into an issue with nodejs 10.1.0 and websockify: https://github.com/novnc/websockify/issues/307#issuecomment-391125660

from websockify.

gdan101 avatar gdan101 commented on May 18, 2024

@mliudev I had node-v6.11.4 on a Windows 7 x64 machine!

from websockify.

SiddharthJyoti avatar SiddharthJyoti commented on May 18, 2024

@kanaka @CendioOssman Does NOVNC support Reverse VNC connection the way it is supported by tightvnc.
Reference: https://kempniu.wordpress.com/2009/03/21/reverse-connections-in-tightvnc/

How can we open novnc viewer in listening mode if answer is yes for above question.

We are using novnc to capture devices inside network however we want to use same web application for capturing(vnc) devices outside the network over the internet. This is because web server can not reach devices with private ip behind the router. We would like to use reverse vnc feature that should allow devices with private ip to share screen to novnc client on web server

from websockify.

samhed avatar samhed commented on May 18, 2024

@SiddharthJyoti Please stop spamming the same question in mutliple places

from websockify.

SiddharthJyoti avatar SiddharthJyoti commented on May 18, 2024

@samhed Your prompt response on the question will be appreciated.

from websockify.

samhed avatar samhed commented on May 18, 2024

noVNC does not support reverse connections like the one described in that blog.

from websockify.

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.