I have WebStorm7 installed on a Windows7 machine.
If I run a meteor project in the Windows7 machine with:
>set NODE_OPTIONS=--debug=47977 & meteor
it prints:
=> Meteor server running on: http://localhost:3000/
=> debugger listening on port 47977
and I can debug with WebStorm7 using the_Node.js Remote debug_ configuration, with Host: 127.0.0.1 and Port: 47977.
If I run a meteor project in a Ubuntu machine (within a Oracle VM VirtualBox, with address 192.168.1.9) with:
$ NODE_OPTIONS="--debug=47977" meteor
it prints only:
=> Meteor server running on: http://localhost:3000/
and I cannot debug with WebStorm from the Windows7 machine using the Node.js Remote debug configuration, with Host: 192.168.1.9 and Port: 47977.
From the ubuntu machine a telnet 127.0.0.1 47977 does not work too. It looks like the debugger is not started at all. What am I doing wrong?
the issue might be related to the fact that node.js debugging is only listening on localhost, so you can't connect to the used port from remote host. The workaround is to use a proxy (see http://delog.wordpress.com/2011/04/08/a-simple-tcp-proxy-in-node-js/, for example)
This proxy can be used as follows:
$: node tcpproxy.js 8585 127.0.0.1 5858
8585 here is the 'exposed' port that webstorm will connect to (you can make this what you wish). You are directing traffic that is coming in on 8585 to 5858 (the local debugging port). Ensure 8585 is open on your firewall if you have one. You have to specify this 'exposed' port in your Remote Debug run configuration as a debug port
Related
I have installed Apache Superset on a remote Linux Server and initialized it on port 8080. When I pull up localhost:8080 on the Linux server, the homepage shows up which suggests that the installation worked as per their instructions here.
When I try to access this page from my laptop (Windows- Browser:Chrome) with http://server-name:8080. It gives me the 'This site can't be reached' page.
I tested using netcat if the connection was open by typing nc -zvw3 server-name 8080 and it gave me Connection to server-name 8080 port [tcp/webcache] succeeded!
I have Jupyter installed on the same server on port 8888 and it works perfectly. Any thoughts would be greatly appreciated.
You may need to try this command by defining the IP address:
superset run -h 0.0.0.0 -p 8080
I'm running express app on remote server (my-domain.com) like that:
node --inspect=0.0.0.0:9229 ./server.js
In intellij idea i've setup debug configuration (Attach Node.js/chrome):
host: my-domain.com
port: 9229
When i click debug button, i get this error:
Invalid response from the remote host. Please check the options in the
debug configuration
I can debug the same application on localhost with this setup:
host: localhost
port: 9229
Why i can't attach to remote node application and debug it? Can intellij idea give me more information about error?
I found cool way that solves my problem and many others, it has been there for ages and i din't use it! :)
For my particular problem it's possible to use ssh tunnels
ssh -L 9221:localhost:9229 user#my-domain.com
Now i can attach node debugger to localhost:9221. It just forwards all traffic from remote port 9229 to my local 9221.
Another this is remote port forwarding:
Just added this line in /etc/ssh/sshd_config:
GatewayPorts yes
Here is
ssh -R 9001:localhost:9000 user#my-domain.com
Now all traffic on port 9000 on remote machine sent to my local node express application. I can debug, do whatever i want
Here's the article i got ideas from: https://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html
I guess I will start at the start of my application.
I am making a full mean-stack application and I want it to run in docker. To use docker I am using a virtualbox with Ubuntu. When I run my docker-compose, everything is working on localhost:4200. Now I want to open my application on my host machine (Windows 7).
When I go to my application via (ip addres should be kept secret, right?) xxx.xxx.xx.xxx:4200/login the page looks fine, but I get these errors:
I am using Angular cli 1.4.1 with node 8.4.0
Why am I getting these errors and how do I fix them?
My docker-compose
Your server which is listening on port 4200 is listening on your xxx.xxx.xxx.xxx interface (not necessary to hide lan IP, but nevermind...).
Your angular application is running on your host system. the localhost is the localhost of your host system, not the guest. so you have two solutions:
changing your urls inside the angular application to point to xxx.xxx.xxx.xxx:4200 instead of localhost:4200.
Forwarding your 4200 port from your host to your guest system using virtual box :
shutdown guest.
select guest and click on settings
go to the network tab.
click on "advanced"
then select "ports redirections" and bind your host 127.0.0.1:4200 to your guest's 4200 port
Unable to remote debug a node server running on a Vagrant box in Chrome from my host machine. The server is configured to run on port 8123.
Node Version: 7.10.0
In Vagrantfile:
config.vm.network :forwarded_port, host: 9229, guest: 9229
config.vm.network :forwarded_port, host: 8123, guest: 8123
From my vagrant box I run:
$ node --inspect index.js
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/84085f07-dc42-4e1e-bdd8-532e6dc5c4c6
--- Customer Service---
Connecting to customer repository...
Connected. Starting server...
Server started successfully, running on port 8123.
When I try to access the url in Chrome from my host machine while I don't get an error the sources tab is empty.
Screenshot of devTools
Based on NodeJS 11591 issue. You can't access the Vagrant stuff via localhost (127.0.0.1), so you need to to specify host explicitly:
$ node --inspect=0.0.0.0:9229 index.js
Then you need to set up Target discovery settings in the Chrome. Note that 192.168.33.11 from my sample is the static IP address providing an access to the Vargant host from the local host:
I'm moving my NodeJS application to docker, and the last problem that I have encountered is debugging the application.
My setup: OSx, boot2docker, docker (based on centos), WebStorm as IDE and debugger.
Here's what I have by now:
Forward 5858 from docker to boot2docker:
docker run -p 5858:5858 ...
Forward 5858 port from boot2docker to host:
VBoxManage controlvm boot2docker-vm natpf1 "boot2docker5858,tcp,127.0.0.1,5858,,5858"
This same setup works to foreword my application ports to host machine.
Port 5858 on the other hand, doesn't seem to react if accessed from outside the docker container.
Inside the docker container it works just fine.
Any idea what can be done to make this work?
Well, I have finally figured it out.
As it seems, node listens only on 127.0.0.1:5858.
To make it listen on all ports, I installed HAProxy on the docker, that forwards the requests from 0.0.0.0:5859 to 127.0.0.1:5858.
Here's the HAProxy configuration if anybody ever needs:
listen l1 0.0.0.0:5859
mode tcp
timeout client 180000
timeout server 180000
timeout connect 4000
server srv1 127.0.0.1:5858
And than add to your Dockerfile:
COPY haproxy.conf haproxy.conf
RUN haproxy -D -f /haproxy.conf