Server Changes on an Ionic Project - node.js

I am simply a beginner at NodeJs. I have a client's Ionic project.
He has sent me
Server Access FTP:
IP, user and pass
and has said, if any server side changes then to be done on server.
app.js file for socket and server side component is in /usr/www
Now i can't find any 'app.js' consisting of node commands in the project. There is an app.js in www/ directory but there is not node command inside. How to access server and where to use the IP, user, pass.
Please explain if you know the answer. Considering me totally nil at node.js and express.js

You can use node-ftp as a FTP client. It is a module for node.js which will provide an interface to communicate with the FTP server. You can refer this link to get more information about node-ftp.

Related

client not connecting to node js server on AWS with WSS/WS protocols

I created a small server using socket.io and node js and deployed in heroku earlier. I was easily able to have client connected to server with wss/ws protocol but when I deployed my app too AWS, Clients are not connecting. I debugged the application in client side but Its just not connecting to server. Did I miss something? are there extra steps needs to followed to make it work?
Thanks.
Answering my own question, I had to add .ebextensions folder with a config in my project root directory. You can look at the following tutorial to make it work https://nikhilmopidevi.github.io/2017/10/18/WebSockets-with-AWS-Elastic-Beanstalk/

client-server websocket

I try to make a client-server app with socket.io.
Socket.io server seems work but the client cannot connect to it. The error i get is about the '/socket.io/socket.io.js' like what it is unable to load it.
So here are my questions
is it mandatory to have server and client in the same folder as we can see in the official demo ?
can we make a nodejs socket.io server without express ?
Depending on how your project is setup, you need to create 2 server files, 1 for the app, and one for the websockets, and every time a user opens the app it should open(and be told where to try and open the connection) a connection to the websockets server. On my websockets apps I have the app running on localhost:3000, and websockets server on localhost:3001 (and tell the app to look for a server on 3001), so really you don't need to have the server files in the same folder, they can be in 2 opposite ends of your computer, as long as the app points to the server, then your fine, once a connection has been opened, the websocket server will see the client, and it should work! Let me know if that make sense.
No, you can download socket.io front-end lib from another sources, for example cdn. Be sure you installed the right version.
Yes, you can make it without express. Express is just another option for creating an socket.io server.
For example, currently in my project that is written in another back-end node framework i'm using the code below to establish the socket.io server.
const io = require("socket.io")(2337);
io.on("connection", socket =>
// some code
)
I fixed the problem of websocket communication between my server and my client.
After inspected my html client file, i saw on the console this error message 'ReferenceError: io is not defined'.
I google that error and i found this.

Node js server with websockify

I need to connect websockets with normal sockets, websockify looks seem the answer, but I donĀ“t really understand what do I need to do whit this info: https://www.npmjs.com/package/node-websockify, do I need to create a Node js server, or only run into my page??
The websockify people were nice enough to create a node js version located here -
enter the command
node websockify.js [--web web_dir] [--cert cert.pem [--key key.pem]] [source_addr:]source_port target_addr:target_port
so the command:
node websockify.js --web web 127.0.0.1:9988 192.168.1.40:5432
would start a "relay" from the target address (the server you don't have access to) to your own proxy server (server you do have access to - where you are proxying the websockets from the vnc server to TCP, which enables you to view the connection via web browser. With this proxy comes a
built-in web server to "serve" the view. so the web option is the location of said HTML, CSS, and JS files to display. If you copy the files from the app directory css-files and the vnc file from the root with all dependencies, you can then view the files by navigating to the source IP address and port and that should take care of it.

Read/write/browse files from client side *desktop* Meteor app?

(I am new to Meteor and NodeJs environments)
I would like to implement a Meteor-based webapp which needs to read/write/browse files on the client's local filesystem. I used the Meteor package arboleya:electrify to make the client side webapp a desktop app, with the hope of having the access rights to read the filesystem (because if Atom can do it, then why not my app).
My problem so far is that I don't understand how I can use an API like NodeJs's fs from a Meteor client.
Edit: This question is for a client Meteor app, connected to a remote Meteor server.
Recent versions of Electrify enable an easy IPC connection between Electron's NodeJS and Meteor as RPC, allowing the Meteor client to remotely call the functions of Electron's NodeJS.

Need help http Server and client server

I have used an application for login, adding friends and chat using node.js and mongoDB.I installed the node.js and monogoDB on ec2 instance. However, I do not know if need to use client server and http server?
Here is the application that I used https://github.com/1karthik/Node.js_UserLogin_Template
note: I am new to node.js and mongoDB
you dont need a "client server". Your http server will serve to your clients some javascript files that will help them to comunicate with your server. If you go in app/public/scripts you can see theese files.

Resources