How to access the webpack output when app hosted on a Digital Ocean droplet? - reactjs

I have installed webpack-dev-server on a Digital Ocean droplet. On starting the service, it says,
http://localhost:8080/
webpack result is served from /
content is served from
But when I access the IP address of the droplet with port 8080 in the browser, it shows connection refused error.
On running a node server, I am able to access it through the IP address

You cannot access a server local from outside the droplet if it is running at port 8080. If you want to get it public, try to run the server at port 80, that is the default public port.
You can configure apache or other HTTP server if you want more features or configs.

As #netoguimaraes suggested, I could not get it running through port 8080. I restarted the webpack-dev-server using port 80 and it worked.
webpack-dev-server --hot --inline --host 0.0.0.0 --port 80

Related

ASP.NET Core 6 Server running on different ports

I'm getting a proxy error
Proxy error: Could not proxy request /api/auth/signin from localhost:51171 to http://localhost:3000/
I have noticed that on the starting the server is running on two different ports...
info: Microsoft.AspNetCore.SpaServices[0]
Starting create-react-app server on port 51171...
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
In the package.json I defined the proxy as follows:
"proxy": "http://localhost:3000"
Changed proxy to: "proxy": "http://localhost:5000" and now its working...
Still dont know why smth is running on 51171

PgAdmin4 website hosting on port 443 (https)

For my project i configured the postgresql and pgadmin4 .. but now i want to make the website secure with proper DNS name and run over port 443. DNS is also done but how to make it run over 443 from 80. ie., from http to https. i made changes in httpd.conf file and added certificates required too. but website is not loading ,still the website is opening on http:// ip address but not on https://
I tried making changes in configuration file too
LL be Much thankful.
how to configure pgadmi4 on port 443 https

How to access specific port in vagrant box laravel/homestead?

I'm working on a node project on my vagrant laravel/homestead box.
Everything works fine, I can access the project when I go to the host define in my /etc/hosts :
192.168.10.10 project
But, I'm trying to build and watch my project with webpack, so I installed webpack-dev-server and I can run it :
http://localhost:8080/
webpack result is served from /
content is served from /home/vagrant/Workspace/Kanban
404s will fallback to /index.html
[...]
webpack: bundle is now VALID.
My problem is, when I try to access project:8080 with my browser, I get a loading error.
A netstat -an | grep 8080 in the vagrant shows me that the box is listening.
I tried to forward ports using homestead.yaml
ports:
- send: 8080
to: 8080
protocol: tcp
But with or without port forwarding, all I get is an error page.
What can I do to make my webpack watcher work ?
Okay, I finnaly found the answer.
The problem was about not ports but the dev-server. It is configured by default to work only on the localhost. The solution was to add a rule to the configuration :
devServer : {
[...]
, host : '0.0.0.0'
}
Setting the host to '0.0.0.0' allows the dev-server to be accessible from anywhere, therefore, to my "real" host.
I found the explanation on a GitHub issue. Too bad that the arguments list wasn't on the official documentation.

Connecting a secured websocket on Google Appengine frontend with managed VM with nodejs runtime

I've trouble in connecting to a wss secured socket server via google appengine frontend with managed VM support.
buy default google exposes only port 8080 in docker image google/nodejs-runtime, Even if expose port 8443 in Dockerfile like below i can connect only to http://localhost:8080 not https://localhost:8443
FROM google/nodejs
WORKDIR /app
ADD package.json /app/
RUN npm install
ADD . /app
EXPOSE 8443
CMD []
ENTRYPOINT ["/nodejs/bin/npm", "start"]
Still i can see port 8080 include in the container
"/nodejs/bin/npm start 8443/tcp, 0.0.0.0:8080->8080/tcp
If i log in to my managed vm instance and run the container image with
docker run -d -p 8443:8443 nodejs.default.wss-check:latest
and try
$curl https://localhost:8443
I get curl: (60) SSL certificate problem: unable to get local issuer certificate, It looks like its connecting but i've to use realdomain name
I've created a issue in github aswell https://github.com/GoogleCloudPlatform/appengine-nodejs-quickstart/issues/13, but not that helpful.
Same set up works like a charm in normal compute instance. but it doesn't auto scale.
Any help on this issue will be appreciated.
The reason you can't curl to https on localhost (curl: (60) SSL certificate problem: unable to get local issuer certificate) is because "localhost" is unknown to any CA. You need to run curl -k https://localhost:8443 to get it to ignore the lack of a certificate for localhost.
Looks like currently Google Managed VM supports Websocket connection only on JAVA
Even if you try websocket connection on with nodejs on GMV it defaults to polling transport. if you wanna see this in live you can use set socket transports, deploy to live and look in to console- network and see which transport its using!
socket.set('transports', [
'websocket'
, 'flashsocket'
, 'htmlfile'
, 'xhr-polling'
, 'jsonp-polling'
]);
We have to wait untill google implements websocket support in Managed VM. If anyone get this working on GMV, Please comment here :)

App Engine Go SDK web server running in Vagrant guest (with port forwarding) not reachable from host

I'm running GAE dev server within a Vagrant guest precise64 box with the following network setup (in my Vagrantfile):
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network :forwarded_port, guest: 8080, host: 9090
end
Which does its thing:
[default] Forwarding ports...
[default] -- 8080 => 9090 (adapter 1)
I start my App Engine server with:
goapp serve
or
dev_appserver.py myappfolder
This starts app engine dev server as expected:
INFO 2013-11-22 dispatcher.py] Starting module running at: http://localhost:8080
In all cases, I'm able to ssh in to the Vagrant guest and curl localhost:8080 successfully.
Unfortunately, from the host I'm unable to get a response from localhost:9090 when running GAE dev web server. Additionally, I've made sure that I don't have anything interfering with the port 9090 on the host machine. Also, I'm almost positive this isn't related to Vagrant as I spun up a quick node.js web server on 8080 and was able to reach it from the host. What am I missing?!!!
You must run the Google App Engine Go dev web server on 0.0.0.0 when leveraging Vagrant port forwarding. Like so:
goapp serve -host=0.0.0.0
See the answers here for more info on ensuring the guest web server is not bound to 127.0.0.1 which is loopback. Web servers that bind to 127.0.0.1 (like App Engine Go dev web server does) by default should be overridden to use 0.0.0.0.

Resources