Javascript client side ssh / ping / scp [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to build a web app that has the capability to scp, ssh, and ping devices on the local network from Javascript client-side. I'm very familiar with Django, but that's all server side code and won't be able to communicate with a device on the local area network.
Is there any way to do this in Javascript? I know that packages like scp2 in NodeJS do exactly what I want, but NodeJS is a server-side framework too. I'm looking for something that does what scp2 does, but client-side.

There is no browser-independent way to do this. You would have to write browser-specific extensions to be able to get access to TCP sockets and the like. Even then if you browserify ssh2 or any of its dependents, you may run into other issues, such as missing node.js functionality not supported by browserify or the browser's extension API.
Alternatively, you could use something like Electron, but that's only if you don't mind the client being a separate application (but still web/JavaScript-based). That would also have the added benefit of having the ssh2 or related code being completely compatible (since Electron uses node.js).

Related

How do I turn my scratch webapp into a Node.js app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 months ago.
Improve this question
I basically have written a webapp from scratch. So I just used a index.html file and a bunch of js and css. Now I want to turn this into a Node.js webapp. How do I get this done in a way that doesn't require much changing of my existing code.
Node.js is designed to allow the server-side execution of JavaScript code. As, if I understand it right, this is a thing that you don't need I am curious why you want to use Node.js. The only thing you want to do is deliver your project files to a client (browser).
Although you could start a HTTP server which delivers the file of your project using JavaScript, this requires much of unnecessary boilerplate code that you don't need to write to get your project live. I would recommend using a regular HTTP server, which is designed to do exactly what you need: deliver files to the client.
Nginx is a lightweight HTTP server, which is easy to configure. Just set the root folder of your project as the HTTP root and nginx will deliver the requested file by itself.
To get started, head over to the Beginners Guide of nginx.
An alternative to nginx would be the Apache HTTP server.

Running Node on windows [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I develop a Node server app. as I develop, I test it with 'run npm' command, which launches the server, then I test it from Chrome and\or Postman.
Now I wish to roll this app (it's a REST service) out to production server. Ours is a Windows server, so how is it usually done? I mean Node is its own server, so is it normal to copy the files over to a directory on the server and set an 'rpm run' to execute there on server start, or do people then typically use IIS as the server? Is something like IISNode a popular way to do things these days...?
If you want my opinion, I myself always run my node projects in somewhere out of windows platform, like containerized or Linux-based production environments.
But you can use nssm.exe to make a windows service with failure recovery and auto startup features from your node project as easy as you want. I can clarify more if you want.
Just visit this article

What should I use as backend in electron application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I understand I can design the UI with HTML CSS JavaScript or any other frontend framework.
I even understand that I can connect to any remote API.
what if I want a standalone application with database. How should I connect to the database ? where should I write my application logic?
I feel like there is a missing part in electron do I supposed to use a node JS web Framework like Express?
or I should write all the program logics in pure node JS without using any framework?
What is the best approach to write electron applications if possible please point me any working example.
It is entirely up to you.
While the client/server (frontend/backend) model we've got used to in web applications is a good idea (separation of concerns), it's not the only way to do things when the client and the server are on the same machine.
Electron is built on top of Node.js. So you can use the usual npm modules in order to connect to whatever database system you want to use and do away with frameworks. For example you can write code to fetch data from the database right into your onclick event handler if you desire so.
Having said that, odds are you will find yourself dealing with an unmanageable bunch of spaghetti code if you're not careful. So, some kind of structure is recommended even if you don't want an entire client/server system.
Also, your "client" and your "server" don't have to communicate through HTTP. The interface can be just plain function (and/or method) calls. Electron also has a message passing system (for example: https://electronjs.org/docs/api/ipc-main that you may use.

Build GUI for a CLI application as a side project [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I rencently developed a Java CLI application, it works fine, but i would like to add a GUI as a side project.
What i have
A standalone Java CLI application
No web framework
No DI
What i want
An electron GUI
The GUI must be standalone and not included in the main project
GUI will have graphs, stats and basic commands like: start stop update and so on
The GUI's state should be in realtime (i means, i would like the GUI to be notified by the Java app if something occurs, instead of spamming the Java app with the GUI)
Since the GUI should be a side project, someway or another, i need to be able to enable/disable the RPC-like (in case someone would like to use CLI only)
My problem
I can't figure out how to communicate between the CLI application and the GUI. I think something like RPC will kind of suit my need, but's i'm not quite familiar to this kind of technologies.
This is basically my question, what would be the most suitable technologie for this project.
There is probably an almost infinite number of ways to do this, but the first thing that I thought of is WebSockets. Presumably you would start your java CLI app first, which could start a WebSocket server. Then start the Electron app, and have it connect to the CLI.
As far as libraries and frameworks, this is explicitly not the place to ask/answer that, and doing so will likely get your question down-voted and closed.

Voice chat in the browser? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
We are looking to implement a group -voice- chat in the browser using node.js on the server. Is this possible?
If you want your solution to be purely JavaScript based on both, server and client side, then you would probably have to wait for the WebRTC, Device API or media capture API and then implement node.js backend for it.
Other than that it is, I would say, a question of Flash oriented APIs on the client side (for accessing devices such as cameras or microphones) and some kind of interoperability with node.js backend in case you don't want to take advantage of Flash Media Server or Red5.
I'm researching and working on the same problem.
This is my proposed stack:-
capturing voice on the client
https://github.com/jiehanzheng/Recorderjs/blob/master/README.md
encoding the captured speech so that it can be shared via Node
https://github.com/jpemartins/speex.js
sharing voice data with multiple users
node.js and socket.io
Somebody wrote a THESIS on this. good read but some missing code in the samples
http://pure.ltu.se/portal/files/36285511/LTU-EX-2012-36247736.pdf
relevant question on so. in particular look at answer by sirjamm
How to Call SPEEX Audio Decode/Encode in HTML5 / JavaScript (Without Flash)
If I get it working, will post the github ref here.
hth

Categories

Resources