BrowserSync no longer loads localhost:3000 since Anvil/Pow install - apache

I have been using BrowserSync and Gulp to proxy MAMP sites with a simple Gulp task that looks something like this:
gulp.task('browser-sync', function() {
browserSync({
proxy: "site-name.localhost"
});
});
Ever since I installed Anvil for Mac which requires Pow, the http://localhost:3000 url that BrowserSync used to resolve, instead it now hangs and doesn't resolve.
It happens in Chrome, Safari and Firefox. I've tried commenting out this line in my hosts file as suggested in Chrome can't open localhost:3000 with Gulp / BrowserSync
#::1 localhost
And I've tried putting all sorts of URLs in the proxy: line including localhost:3000 and changing the port number - neither of which get me back to where I was before the Pow install.

just in case someone's looking for an answer. uninstalling Pow + Anvil seems to fix it.
curl get.pow.cx/uninstall.sh | sh

Related

How to serve Vue application over HTTPS?

I am trying to serve Vue application over HTTPS instead of HTTP.
I have tried to add --https flag to webpack-dev-server and add https: true in build/webpack.dev.cong.js but when I try to open the app in the browser it crashes with the following error:
[DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
internal/buffer.js:945
class FastBuffer extends Uint8Array {}
^
RangeError: Invalid typed array length: -4095
at new Uint8Array (<anonymous>)
Is there something that I missed or what is the solution for this?
And if the HTTPS properly configured to webpack devServer, after building the project it would work the same when served with web server like nginx or I have to add some reverse proxying?
If you want to do this on your local machine, then you are going to want to use NGINX to serve up the HTTPS-traffic and use it to reverse proxy to whatever port on your local machine that you mount your webpack-dev-server. There might be a way to get Webpack to do this, but it wasn't designed to do this.

How to run Vue-cli project using https on Windows

I am trying to run a vue-cli project using https.
As per the instructions here How to run Vue.js dev serve with https?
I've added the https setting to the vue.config.js as per below:
module.exports = {
devServer: {
https: true
}
}
When I run the app it correctly runs as https://localhost:8080 however Chrome throws an ERR_CERT_AUTHORITY_INVALID error.
It appears I need to setup an SSL certificate in Windows and set some configuration in vue.config.js. Does anyone know how to do this? Note, this question applies specifically to Windows.
This happened to me when I was building multiple applications that were sometimes sharing the same port. I fixed it by switching to a different port:
module.exports = {
devServer: {
port: 8081
}
}

Disable SSL on localhost using MAMP

Month ago I've installed MAMP (not PRO) and I set SSL for localhost following this tutorial. It works perfectly by the way:
https://torbjornzetterlund.com/how-to-get-ssl-working-on-mamp-for-os-x/
Today I removed MAMP and install it again, but I can't access localhost with http://localhost, it redirects to https:// and connection is not allowed.
The apache config is the default config.
How can I remove/disable the openSSL I set?
I tried solutions mentioned here without success
Wordpress always redirects to https after copying to localhost
But the only thing that worked was to change default MAMP ports under MAMP > Preferences
I ran into a similar issue. I set up a local host SSL environment for the one site as required to develop with the Facebook Api and instagram api.
When I went to update the site to a fresh directory with the newest version in production, it would fail because the SSL is not setup for the new directory yet. Redirecting me to https://www.localhost.
My solution was to backtrack using documentation on how to enable SSL on the site. What I found is this:
This is tested on MAMP Free version, possibly works on PRO but untested.
The instructions state:
Open /Applications/MAMP/conf/apache/httpd.conf and uncomment Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf.
So I navigated to that directory, opened the httpd-ssl.conf file in my text editor and located the uncommented line, commented this line using "#" and save. Doing this resulted in disabling the ssl behavior and retains all my previous configuration.
When your ready to go back to SSL, uncomment that line and make sure you have reconfigured your ssl to the new directory(Github below explains how to configure for ssl). Here is the github I reference for the work. Good luck!
https://gist.github.com/jfloff/5138826
Line #3
I am using MAMP Free version and accidentally launched the PRO version.
It changed ports for the Free version too... So suddenly localhost and other virtual hosts changed to SSL.
Reseting ports in the Free Version with the button "Set Web & MySQL ports to 80 & 3306" worked for me.

Starting Stencil - Localhost URL Never Loads

I'm new to developing with Stencil, and I'm having a bit of trouble getting started.
After running:
stencil start
I get the startup information, and ASCII graphic loading in terminal, along with the localhost URLs which should allow me to view the frontend and work on the store. Whenever I visit the http://localhost:3000 URL, nothing ever loads.
It seems that something is in fact working, because when I edit and save a SCSS file, I get a terminal line recognizing that a file was changed.
I'm running on macOS High Sierra, v. 10.13.3
I've tried uninstalling and reinstalling stencil-cli, along with the JS utilities a dozen times and also tried different versions of Node -- namely 4.4.0, 6.10.3, and 7.9.0
Is there anything else I can do to troubleshoot? I sat down with a coworker and ran through the setup on their machine and everything worked perfectly. This must be an isolated issue somehow to my machine, but I'm not sure how to proceed.
Any help would be greatly appreciated.
Thank you!
The issue was has been resolved. The following lines were completely missing from my hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

npm node app.js different apache

I was able to start my own RTCMultiConnection in my dedicated hosting.
https://github.com/muaz-khan/RTCMultiConnection
The problem I hit is when I want to integrate it in a full php / ajax / jquery website I made.
A site with login using ajax calls.
because the RTCMultiConnection requires node js and a different port (like https://www.__MyDomain.com:9001/ ),
I thought I could insert it in my site usign a XMLHttpRequest.
**** Problem ; I get a Allow-Control-Allow-Origin error
-- I tried to add it in .htaccess but without success... ;(
-- I went to my regular php.ini and installed mod_headers ; same thing no success ;(
•• I tried curl -I https://__MyDomain.com:9001/
and "Surprise surprise I get : HTTP/1.1 200 OK......
but my regular site (without the :9001) have Apache/2.2.31
The QUESTION HERE (is related to node and not RTCMultiConnection) ; WHY does "node server.js" have a different apache ???
Is it possible to "tell" or "ask" node to use the same apache config that I have ??
Thanks
You can keep running server.js on port 9001 and access/use/invoke socket.io/nodejs from your main PHP website. E.g.
rtcMultiConnection.socketURL = 'https://yourdomain.com:9001/';
Now your PHP pages will successfully use socket.io that is running on port 9001.
You can try this for testing purpose:
rtcMultiConnection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';
Note: You can NOT run both nodejs and appache/php on same port: 80 or 443. That's why it is suggested to keep running nodejs on-a-separate-port 9001 and access/use socket.io from your PHP pages.