Git Product home page Git Product logo

butlerx / wetty Goto Github PK

View Code? Open in Web Editor NEW
4.1K 102.0 660.0 5.2 MB

Terminal in browser over http/https. (Ajaxterm/Anyterm alternative, but much better)

Home Page: https://butlerx.github.io/wetty

License: MIT License

Dockerfile 1.05% TypeScript 65.49% SCSS 1.95% JavaScript 28.08% HTML 2.06% CSS 1.37%
hacktoberfest wetty ajaxterm anyterm terminal xterm-js xtermjs xterm hacktoberfest-accepted

wetty's People

Contributors

2sheds avatar acalatrava avatar antonyjim avatar butlerx avatar deniskramer avatar dependabot[bot] avatar gelim avatar harrisonpace avatar imuli avatar jarrettgilliam avatar jerch avatar kmlucy avatar koushikmln avatar krishnasrinivas avatar lucamilanesio avatar mikr13 avatar mirtouf avatar mtpiercey avatar nealey avatar nils1729 avatar nosemeocurrenada avatar perpen avatar rabchev avatar sergeir82 avatar shimile avatar souradutta avatar strubbl avatar tony2guo avatar userdocs avatar warr1024 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wetty's Issues

make internal urls relative?

I've set up wetty to work behind apache with modproxy. It should respond to: https://myserver/shell/
Unfortunately, it looks like urls are absolute, and indeed i get the following errors:

https://myserver/wetty/hterm_all.js Failed to load resource: the server responded with a status of 404 (Not Found)
https://myserver/wetty/socket.io/socket.io.js Failed to load resource: the server responded with a status of 404 (Not Found)
https://myserver/wetty/wetty.js Failed to load resource: the server responded with a status of 404 (Not Found)

With relative urls they should be https://myserver/shell/wetty/wetty.js

Upstart script not working

I tried on debian 8, the script was as following:

# Upstart script
# /etc/init/wetty.conf
description "Web TTY"
author      "Wetty"
start on started mountall
stop on shutdown
respawn
respawn limit 20 5
exec sudo -u thee wetty -p 5555

Can't install with node 4

Hi,

Wetty was perfectly working, but I have updated to last node version, and now I can't re-install it.
Is the last version of node supported ? I hope because I really like wetty !

Here is my stack trace.

Thanks !

nodejs@dev:~$ npm install -g wetty
npm WARN deprecated [email protected]: use serve-favicon module
/home/nodejs/.node-v4.2.2-linux-x64/bin/wetty -> /home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/bin/wetty.js

[email protected] install /home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/pty.js
node-gyp rebuild

make: Entering directory '/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/pty.js/build'
CXX(target) Release/obj.target/pty/src/unix/pty.o
In file included from ../src/unix/pty.cc:20:0:
../../nan/nan.h:324:27: error: redefinition of ‘template v8::Local Nan::imp::NanEnsureHandleOrPersistent(const v8::Local&)’
NAN_INLINE v8::Local NanEnsureHandleOrPersistent(const v8::Local &val) {
^
../../nan/nan.h:319:17: note: ‘template v8::Handle Nan::imp::NanEnsureHandleOrPersistent(v8::Handle&)’ previously declared here
v8::Handle NanEnsureHandleOrPersistent(const v8::Handle &val) {
^
../../nan/nan.h:344:27: error: redefinition of ‘template v8::Local Nan::imp::NanEnsureLocal(v8::Handle&)’
NAN_INLINE v8::Local NanEnsureLocal(const v8::Handle &val) {
^
../../nan/nan.h:334:27: note: ‘template v8::Local Nan::imp::NanEnsureLocal(const v8::Local&)’ previously declared here
NAN_INLINE v8::Local NanEnsureLocal(const v8::Local &val) {
^
../../nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../../nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
, node::smalloc::FreeCallback callback
^
../../nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(char_, size_t, int)’:
../../nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(const char_, uint32_t)’:
../../nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate_, const char_&, uint32_t&)’ is ambiguous
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
../../nan/nan.h:768:67: note: candidates are:
In file included from ../../nan/nan.h:25:0,
from ../src/unix/pty.cc:20:
/home/nodejs/.node-gyp/4.2.2/include/node/node_buffer.h:31:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, v8::Localv8::String, node::encoding)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate_ isolate,
^
/home/nodejs/.node-gyp/4.2.2/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/nodejs/.node-gyp/4.2.2/include/node/node_buffer.h:43:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, char_, size_t)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate,
^
/home/nodejs/.node-gyp/4.2.2/include/node/node_buffer.h:43:40: note: no known conversion for argument 2 from ‘const char_’ to ‘char_’
In file included from ../src/unix/pty.cc:20:0:
../../nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocalv8::Object’ to ‘v8::Localv8::Object’
return node::Buffer::New(v8::Isolate::GetCurrent(), size);
^
../../nan/nan.h: In function ‘v8::Localv8::Object NanBufferUse(char_, uint32_t)’:
../../nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
pty.target.mk:90: recipe for target 'Release/obj.target/pty/src/unix/pty.o' failed
make: *_* [Release/obj.target/pty/src/unix/pty.o] Error 1
make: Leaving directory '/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/pty.js/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 2.6.32-39-pve
gyp ERR! command "/home/nodejs/.node-v4.2.2-linux-x64/bin/node" "/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/pty.js
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1

[email protected] install /home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/websocket
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/websocket/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
COPY Release/validation.node
make: Leaving directory '/home/nodejs/.node-v4.2.2-linux-x64/lib/node_modules/wetty/node_modules/websocket/build'
/home/nodejs/.node-v4.2.2-linux-x64/lib
└── (empty)

npm ERR! code 1

security risks http

I know https is a nobrainer when it comes to security.
But how likely is it that somewhere somebody is sniffing http websocketpackets for passwords, of a http wetty session running in a docker on some server.

I had issues with the nginx proxy method you suggested..

I had to modify the proxy configuration for nginx as follows:
(otherwise the js-files are not loaded..) just for info :)
Thank you for this GREAT software! :-) and keep up the good
work!!

Kind regards,
-Ingo

location ^~ /wetty {
proxy_pass http://127.0.0.1:3000/wetty/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 43200000;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;

}

Fails to connect when websockets are blocked

I'm a new fan of wetty. The only problem is that I work behind a firewall that (evidently) blocks web sockets. Bummer. This was a confusing discovery for me at first because I have been using tty.js (another node.js web terminal that uses web sockets). After looking at the code and a quick Google search I discovered that wetty uses the standard WebSocket API while tty.js uses a 3rd party called socket.io.js which, if web sockets aren't available, falls back to the following technologies:

  • Flash Socket
  • AJAX long-polling
  • AJAX multipart streaming
  • IFrame
  • JSONP polling

I guess my question is, have you considered using socket.io.js to make wetty available behind firewalls that block web sockets?

Thanks for your time.

Install issues on Ubuntu 14.04

Hey,

I'm not sure if I have something wrong going on but I can't seem to get this installed. I was hoping that you could have a look and see if anything jumps out at you. Node is v0.12.4 and NPM is 2.10.1.

Thanks and great work!

vagrant@vagrant-ubuntu-trusty-64 ~/vendor/wetty — u:1 j:0vboxguest             248441  2 vboxsf
 git:master (14:49:37 06.14)
#5 ❯❯❯ npm install

> [email protected] install /home/vagrant/vendor/wetty/node_modules/waitpid
> node-gyp rebuild

make: Entering directory `/home/vagrant/vendor/wetty/node_modules/waitpid/build'
  CXX(target) Release/obj.target/waitpid/src/waitpid.o
../src/waitpid.cc:11:36: error: ‘Arguments’ does not name a type
 static Handle<Value> Waitpid(const Arguments& args) {
                                    ^
../src/waitpid.cc:11:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 static Handle<Value> Waitpid(const Arguments& args) {
                                               ^
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> Waitpid(const int&)’:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../src/waitpid.cc:12:15: error: within this context
   HandleScope scope;
               ^
../src/waitpid.cc:15:13: error: invalid types ‘const int[int]’ for array subscript
   if (args[0]->IsInt32()) {
             ^
../src/waitpid.cc:16:19: error: invalid types ‘const int[int]’ for array subscript
     child = args[0]->Int32Value();
                   ^
../src/waitpid.cc:22:40: error: no matching function for call to ‘v8::Object::New()’
     Local<Object> result = Object::New();
                                        ^
../src/waitpid.cc:22:40: note: candidate is:
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
   static Local<Object> New(Isolate* isolate);
                        ^
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note:   candidate expects 1 argument, 0 provided
../src/waitpid.cc:25:19: error: ‘New’ is not a member of ‘v8::String’
       result->Set(String::New("exitCode"), Integer::New(WEXITSTATUS(status)));
                   ^
../src/waitpid.cc:25:76: error: no matching function for call to ‘v8::Integer::New(int)’
       result->Set(String::New("exitCode"), Integer::New(WEXITSTATUS(status)));
                                                                            ^
../src/waitpid.cc:25:76: note: candidate is:
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note:   candidate expects 2 arguments, 1 provided
../src/waitpid.cc:26:19: error: ‘New’ is not a member of ‘v8::String’
       result->Set(String::New("signalCode"), Null());
                   ^
../src/waitpid.cc:26:51: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
       result->Set(String::New("signalCode"), Null());
                                                   ^
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here
   friend Handle<Primitive> Null(Isolate* isolate);
                            ^
../src/waitpid.cc:27:20: error: ‘class v8::HandleScope’ has no member named ‘Close’
       return scope.Close(result);
                    ^
../src/waitpid.cc:30:19: error: ‘New’ is not a member of ‘v8::String’
       result->Set(String::New("exitCode"), Null());
                   ^
../src/waitpid.cc:30:49: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
       result->Set(String::New("exitCode"), Null());
                                                 ^
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here
   friend Handle<Primitive> Null(Isolate* isolate);
                            ^
../src/waitpid.cc:31:19: error: ‘New’ is not a member of ‘v8::String’
       result->Set(String::New("signalCode"), Integer::New(WTERMSIG(status)));
                   ^
../src/waitpid.cc:31:75: error: no matching function for call to ‘v8::Integer::New(int)’
       result->Set(String::New("signalCode"), Integer::New(WTERMSIG(status)));
                                                                           ^
../src/waitpid.cc:31:75: note: candidate is:
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note:   candidate expects 2 arguments, 1 provided
../src/waitpid.cc:32:20: error: ‘class v8::HandleScope’ has no member named ‘Close’
       return scope.Close(result);
                    ^
../src/waitpid.cc:34:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Undefined());
                  ^
../src/waitpid.cc:34:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return scope.Close(Undefined());
                                  ^
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../src/waitpid.cc:37:44: error: ‘New’ is not a member of ‘v8::String’
     return ThrowException(Exception::Error(String::New("Not an integer.")));
                                            ^
../src/waitpid.cc:37:75: error: ‘ThrowException’ was not declared in this scope
     return ThrowException(Exception::Error(String::New("Not an integer.")));
                                                                           ^
In file included from ../src/waitpid.cc:1:0:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h: In function ‘void init(v8::Handle<v8::Object>)’:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../src/waitpid.cc:43:15: error: within this context
   HandleScope scope;
               ^
../src/waitpid.cc:44:45: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [8], v8::Handle<v8::Value> (&)(const int&))’
   NODE_SET_METHOD(target, "waitpid", Waitpid);
                                             ^
../src/waitpid.cc:44:45: note: candidate is:
In file included from ../src/waitpid.cc:2:0:
/home/vagrant/.node-gyp/0.12.4/src/node.h:228:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback)
 inline void NODE_SET_METHOD(const TypeName& recv,
             ^
/home/vagrant/.node-gyp/0.12.4/src/node.h:228:13: note:   template argument deduction/substitution failed:
../src/waitpid.cc:44:45: note:   cannot convert ‘Waitpid’ (type ‘v8::Handle<v8::Value>(const int&)’) to type ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’
   NODE_SET_METHOD(target, "waitpid", Waitpid);
                                             ^
make: *** [Release/obj.target/waitpid/src/waitpid.o] Error 1
make: Leaving directory `/home/vagrant/vendor/wetty/node_modules/waitpid/build'
 build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-53-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vagrant/vendor/wetty/node_modules/waitpid
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm WARN deprecated [email protected]: use serve-favicon module

> [email protected] install /home/vagrant/vendor/wetty/node_modules/pty.js
> node-gyp rebuild

make: Entering directory `/home/vagrant/vendor/wetty/node_modules/pty.js/build'
  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:82:20: error: ‘Arguments’ does not name a type
 PtyGetStatus(const Arguments&);
                    ^
../src/unix/pty.cc:82:29: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
 PtyGetStatus(const Arguments&);
                             ^
../src/unix/pty.cc:376:20: error: ‘Arguments’ does not name a type
 PtyGetStatus(const Arguments& args) {
                    ^
../src/unix/pty.cc:376:31: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 PtyGetStatus(const Arguments& args) {
                               ^
In file included from /home/vagrant/.node-gyp/0.12.4/src/node.h:61:0,
                 from ../node_modules/nan/nan.h:157,
                 from ../src/unix/pty.cc:16:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> PtyGetStatus(const int&)’:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../src/unix/pty.cc:377:15: error: within this context
   HandleScope scope;
               ^
../src/unix/pty.cc:379:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (args.Length() != 1
            ^
../src/unix/pty.cc:380:17: error: invalid types ‘const int[int]’ for array subscript
       || !args[0]->IsNumber()) {
                 ^
../src/unix/pty.cc:382:7: error: ‘New’ is not a member of ‘v8::String’
       String::New("Usage: pty.status(pid)")));
       ^
../src/unix/pty.cc:382:45: error: ‘ThrowException’ was not declared in this scope
       String::New("Usage: pty.status(pid)")));
                                             ^
../src/unix/pty.cc:385:19: error: invalid types ‘const int[int]’ for array subscript
   int pid = args[0]->IntegerValue();
                   ^
../src/unix/pty.cc:387:53: error: no matching function for call to ‘v8::Number::New(std::map<int, int>::mapped_type&)’
   Local<Number> statusCode = Number::New(pidMap[pid]);
                                                     ^
../src/unix/pty.cc:387:53: note: candidate is:
In file included from /home/vagrant/.node-gyp/0.12.4/src/node.h:61:0,
                 from ../node_modules/nan/nan.h:157,
                 from ../src/unix/pty.cc:16:
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
   static Local<Number> New(Isolate* isolate, double value);
                        ^
/home/vagrant/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note:   candidate expects 2 arguments, 1 provided
../src/unix/pty.cc:388:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(statusCode);
                ^
../src/unix/pty.cc: In function ‘void init(v8::Handle<v8::Object>)’:
../src/unix/pty.cc:616:49: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handle<v8::Object>&, const char [7], v8::Handle<v8::Value> (&)(const int&))’
   NODE_SET_METHOD(target, "status", PtyGetStatus);
                                                 ^
../src/unix/pty.cc:616:49: note: candidate is:
In file included from ../node_modules/nan/nan.h:157:0,
                 from ../src/unix/pty.cc:16:
/home/vagrant/.node-gyp/0.12.4/src/node.h:228:13: note: template<class TypeName> void node::NODE_SET_METHOD(const TypeName&, const char*, v8::FunctionCallback)
 inline void NODE_SET_METHOD(const TypeName& recv,
             ^
/home/vagrant/.node-gyp/0.12.4/src/node.h:228:13: note:   template argument deduction/substitution failed:
../src/unix/pty.cc:616:49: note:   cannot convert ‘PtyGetStatus’ (type ‘v8::Handle<v8::Value>(const int&)’) to type ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’
   NODE_SET_METHOD(target, "status", PtyGetStatus);
                                                 ^
../src/unix/pty.cc: In function ‘void PtyFork(const v8::FunctionCallbackInfo<v8::Value>&)’:
../src/unix/pty.cc:228:34: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
       if (strlen(cwd)) chdir(cwd);
                                  ^
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
make: Leaving directory `/home/vagrant/vendor/wetty/node_modules/pty.js/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-53-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vagrant/vendor/wetty/node_modules/pty.js
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
\
> [email protected] install /home/vagrant/vendor/wetty/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/home/vagrant/vendor/wetty/node_modules/websocket/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
  COPY Release/validation.node
make: Leaving directory `/home/vagrant/vendor/wetty/node_modules/websocket/build'
npm ERR! Linux 3.13.0-53-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the waitpid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls waitpid
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/vendor/wetty/npm-debug.log

About socket.io version

Which version of socket.io does wetty support?
When I use Atmosphere extensions for socket.io to Integrate with wetty, everything else seems good ,except a black screen on my browser.
In my case , I used socket.io 0.98 in wetty ,so I wanna know is it about socke.io version?
thx

Expose --sshhost and --sshport as GET parameters

Hi

It would be great if Wetty would expose --sshhost and --sshport as GET parameters. This would make it very easy to integrate Wetty into web-based server management panels.

Kind regards
Merlijn Sebrechts

--sshhost and --sshport options do not work

I'm trying to run wetty on hostA using

node app.js --sshhost hostB --sshport 22 -p 3000

From the Readme and the cmd options I was thinking this would allow me to open http://hostA:3000 and open a ssh settion to hostB. However, this seems not to work. The ssh connection that opens always points to hostA.

Is this a issue or just undocumented?

Numerous zombie processes after logging out of wetty terminal

I am noticing that there are quite a few linux zombie processes after normal login and out through wetty. All the linux zombie process are [ssh] so I suspect that the ssh is never closed properly by wetty. Unfortunately, aside from restarting the node server, I don't quite know how to fix this. Any ideas?

docker build from the latest version doesn't run

If I try the dockerhub available version, it runs fine, but it seems something is broken with the npm install. I have the same issue if I try to do install it out of docker, first I thought it was my environment, so it's why I decided to test it with the existing Dockerfile.

root@obelix:~/ludo-tests/wetty# git branch
* master
root@obelix:~/ludo-tests/wetty# git rev-parse HEAD
6663504f0df27322940f56fc3f8590990bc3d409
root@obelix:~/ludo-tests/wetty# docker run -p 3000:3000 7c4cfb5d4171

module.js:340
    throw err;
          ^
Error: Cannot find module '../build/Release/pty.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/app/node_modules/pty.js/lib/pty.js:9:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
root@obelix:~/ludo-tests/wetty# 

using under non-root (sub) urls

Hello, thanks for great work.

To work with sub urls.(for example https://blabla.com/wetty/) I have changed these lines.

Some changes are just non-important relative path things but as you notice that I had to remove socket.io's "wetty" name from both path and app code (//).

It is seems completely Ok now.
However I am not sure why I need to remove socket.io name and any side-effects of it or even don't know is it a kind of bug :/

Note: I have also another service that is running at root path. (managed by nginx https proxy)

index.html:
<script src="wetty/hterm_all.js"></script>
<script src="socket.io/socket.io.js"></script>
<script src="wetty/wetty.js"></script>

app.js:
_ var io = server(httpserv,{path: '//socket.io'});_

I use latest LTS version(4x) of nodejs and LTS(14.04) ubuntu server.
thanks :)

German umlauts and some Alt Gr problems

I am having problems with german umlauts (äöüÄÖÜ) in wetty and I am not sure if it's a problem upstream or related to wetty. I managed to get german umlauts displayed correct if I set the keyboard character endoding to raw in the JavaScript console: `term.keyboard.characterEncoding='raw'``

The second problem is related to Alt Gr key. I am unable to print a '@' sign. If I press AltGr+Q I am getting the follwing characters in the wetty console ^[. I can copy & paste an '@' sign from an external editor as well as in wetty itself. So I doubt it an encoding problem or something.

Obviously I am a german user, with a german keyboard layout :-)

Any ideas?

Option to only listen to specific net

the program actually listen to 0.0.0.0. It would be nice (and more secure) to have an option to make it bind to just local network or localhost, like many other programs do.

Installing Failed Pty.js

Hello, I've tried installing from a git clone and received the following error:

npm http GET https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz
npm http 200 https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz
npm http 200 https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz

> [email protected] install /root/wetty/node_modules/pty.js
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-57-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/wetty/node_modules/pty.js
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1
npm ERR! Error: ENOENT, lstat '/root/tmp/npm-18900-1ajJ8_LR/1453153736493-0.21297033480368555/package/dist/lodash.underscore.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Linux 3.13.0-57-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /root/wetty
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /root/tmp/npm-18900-1ajJ8_LR/1453153736493-0.21297033480368555/package/dist/lodash.underscore.js
npm ERR! fstream_path /root/tmp/npm-18900-1ajJ8_LR/1453153736493-0.21297033480368555/package/dist/lodash.underscore.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/root/tmp/npm-18900-1ajJ8_LR/1453153737388-0.06007509049959481/package/test/test.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Linux 3.13.0-57-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /root/wetty
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /root/tmp/npm-18900-1ajJ8_LR/1453153737388-0.06007509049959481/package/test/test.js
npm ERR! fstream_path /root/tmp/npm-18900-1ajJ8_LR/1453153737388-0.06007509049959481/package/test/test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! tar pack Error reading /root/tmp/npm-18900-1ajJ8_LR/1453153736534-0.860922196181491/package
npm ERR! addLocalDirectory Could not pack "/root/tmp/npm-18900-1ajJ8_LR/1453153736534-0.860922196181491/package" to "/root/.npm/underscore.string/2.                                                                                                                            3.3/package.tgz"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/wetty/npm-debug.log
npm ERR! not ok code 0

Wetty crashes silently when one of multiple browser windows is closed

Hi,

I am running wetty inside of a docker container. When I open multiple browser windows and close one of them, then wetty will hang. The node processs is still running but none of the terminal windows is responding anymore.

Steps to reproduce:

Open wetty on first computer, log in, do a "watch date".
Open wetty with another chrome browser on another computer. Close the tab without loging in. Or log in and then press STRG+D.

The watch date in the first window will stop after a few seconds. No new connections are possible anymore until the docker container is restarted,

Hope you can reproduce and fix this. Because Wetty seems like a really cool solution.

Kind regards,

Thorsten

wetty on AIX

I'm trying to build wetty on AIX machine. I have python 2.7.6 installed on this machine. By following the build steps in README, I got this error:

ImportError: 0509-022 Cannot load module /opt/freeware/lib/python2.7/lib-dynl
oad/binascii.so.
0509-150 Dependent module libz.so could not be loaded.
0509-022 Cannot load module libz.so.
0509-026 System error: A file or directory in the path name does not exi
st.
0509-022 Cannot load module /opt/freeware/lib/python2.7/lib-dynload/bina
scii.so.
0509-150 Dependent module /opt/freeware/lib/python2.7/lib-dynload/bina
scii.so could not be loaded.
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/ibm/node/lib/node_modules/npm/node
_modules/node-gyp/lib/configure.js:422:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System AIX 1
gyp ERR! command "/ibm/node/bin/node" "/ibm/node/lib/node_modules/npm/node_modul
es/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/smui-install/wetty/node_modules/pty.js
gyp ERR! node -v v4.4.1
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm ERR! AIX 1
npm ERR! argv "/ibm/node/bin/node" "/ibm/node/bin/npm" "install"
npm ERR! node v4.4.1
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pty.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /tmp/smui-install/wetty/npm-debug.log

Anyone got this error before? Any ideas?

Thanks!

Software keyboard on mobile devices

Probably this is not a priority, anyway on mobile devices (at least Firefox OS and iOS) the keyboard isn't shown when focusing the app, which makes it unusable. Is there anything that can be done?

Better spash image

Right now, when I share this github link, it's a big picture of your beautiful face! It's a little off putting. I encourage you to make it display something else.

minor suggestions for improvement

Hi,

I got this working for my personal server. It is pretty darn useful. Kudos for putting this project together and making it open source.

The only minor hiccup was that I use a non-standard SSH port and I want to let the user choose the username (the script as-is forces the user to be the same user that started the node server).

So, I put together a simple perl script (sshuser.pl) that is called by app.js that looks like this:

#!/usr/bin/perl

my $addr = $ARGV[0];

print "Enter your username: ";
my $username = <STDIN>;
chomp ( $username );
exec ("/usr/bin/ssh -p <non standard ssh port here> $username\@$addr");

Maybe you or other user may find it useful.

Terry

Can't login as `root'

I am running wetty in a vagrant box (debian-7.8.xxx) from puppetlab and I can't login using root. Entering the root username triggers the `Login incorrect' message.

Is `root' hardcoded to be refused ? I can login fine using ssh.

ioctl(2) failed.

Hi, I can't get the terminal to work properly. I keep getting this error: Error: Error: ioctl(2) failed.
Any ideas? Thanks!

I have a problem about ctrl-V

i wish it's used in my Education,
and hope to reduce students cheating,
so i want to remove ctrl-V,
i tried modify codes,
but i can't ORZ,
can you give me some proposal?

Security - Please add Fail2ban support

Hi, I've tried Wetty lately and suspected that it may let the hacker to brute-force user's password by repeatedly guessing it. Please implement Fail2ban configs to block repeated login failure users.

Unable to copy in OS X

I am unable to copy text from wetty under OS X. I can paste just fine and I see the scissors pop up when I hit COMMAND-C

command logging

Qs: Once we have term via wetty, where do the commands that get typed in the wetty term get logged ?

This is useful for auditing.

Regards

Tmux copy and pasting not working

Tmux mouse selection and CTRL+[ copy and paste flash the scissor icon but don't copy to the system clip board. Tested in Chrome on Windows and Linux and Firefox on Windows.

tab autocompletion?

Hi, nice work!! It's been very useful...

one minor thing, it seems that "tab" autocompletion is not supported or at least I couldn't make it to wotk.

Any suggestions?

What browsers does Wetty support?

Hi

I can't seem to find any information on what browsers Wetty support. Is this Chrome only? Is it possible to add this information in the readme?

Kind regards
Merlijn

doesn't compile with pty.js Version 0.2.7-1

Hi,

the verion 0.2.7-1 of pty.js doesn't compile with my aktuall Arch Linux Version, gcc Version 5.2.0?

With the version 0.3.0 of pty.js the installation workes and wetty is runnning.

Thanks for the greate work.

mfG Matthias

reverse proxy

I'm using a reverse proxy called Pound on my system.

On connecting:

http on port 8080
Thu Jul 16 2015 12:24:45 GMT+0200 (CEST) Connection accepted.
Error: TypeError: Cannot call method 'end' of undefined

And have only a red frozen cursor on the client - no error messages in the client console.

How could I troubleshoot this, and what settings are recommended in general for a proxy?

Permission denied (publickey)

I am trying to run wetty on a AWS EC2 instance. If a start the app.js with root I can access (using nginx as reverse proxy) to from public but when I try to do so using http://domainname:3000/wetty/ssh/ it returns Permission denied (publickey). The user is a valid SSH user and it can access the remote server from my local machine though.

Paste

Hi there. Great work!

Is there a way to paste from a clipboard, directly to the terminal?

Copy seems to work with ctrl-C, but ctrl-V?

Thank you, ..

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.