GithubHelp home page GithubHelp logo

Comments (16)

sgtaziz avatar sgtaziz commented on July 20, 2024 6

It also causes the same issue when using http://.
After looking into it, it seems like the http module doesn't like protocols in its options. I temporarily fixed it by removing "https://" and "http://" in options.host under the httpServer function in server.js.

from laravel-echo-server.

Thaars avatar Thaars commented on July 20, 2024 2

No, the protocol option is still needed, but you don't need the protocol in the host option anymore. This is a part of my json config.

{
    "host": "example.local",
    "port": "6001",
    "protocol": "https"
}

from laravel-echo-server.

tlaverdure avatar tlaverdure commented on July 20, 2024

Is that immediately after startup? Or did you try and perform an action that caused that to occur?

from laravel-echo-server.

tlaverdure avatar tlaverdure commented on July 20, 2024

Your ssl files also don't match your host.

from laravel-echo-server.

pderiy avatar pderiy commented on July 20, 2024

It happens just after startup.
Just try to add https prefix and you will have same problem.
Ssl files does match my host. I wanted to change my host url, but forget to change ssl files names.

from laravel-echo-server.

sgtaziz avatar sgtaziz commented on July 20, 2024

I'm experiencing the same problem as well. My host matches my crt and key. Using "host": "https://dev.horizonservers.net"
Was working fine prior to updating to 1.0

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on July 20, 2024

I'm having the same issue.

Initially I thought it was because I was running node 5 (see other thread). But I upgraded to Node 6.5.0 and I'm still getting this on homestead. Here's a print out of my shell:


22:31:02 ✔ vagrant@homestead $ npm -v
3.10.3

[~/Code/new.wn.dev]
22:31:04 ✔ vagrant@homestead $ node -v
v6.5.0

[~/Code/new.wn.dev]
22:31:07 ✔ vagrant@homestead $ npm outdated

[~/Code/new.wn.dev]
22:31:13 ✔ vagrant@homestead $ npm ls laravel-echo-server
/home/vagrant/Code/new.wn.dev
└── [email protected]

[~/Code/new.wn.dev]
22:31:28 ✔ vagrant@homestead $ cat laravel-echo-server.json
{
        "appKey": "drmgqfube6b4t<snip>n86gtjqpqjc6u1j7d",
        "authEndpoint": "/broadcasting/auth",
        "authHost": "http://new.wn.dev",
        "database": "redis",
        "databaseConfig": {
                "redis": {},
                "sqlite": {
                        "databasePath": "/database/laravel-echo-server.sqlite"
                }
        },
        "devMode": false,
        "host": "http://new.wn.dev",
        "port": "6001",
        "protocol": "http",
        "referrers": [],
        "sslCertPath": "",
        "sslKeyPath": "",
        "verifyAuthPath": true,
        "verifyAuthServer": false
}[~/Code/new.wn.dev]


22:31:54 ✔ vagrant@homestead $ laravel-echo-server start

L A R A V E L  E C H O  S E R V E R

Starting server...

✔ Running at http://new.wn.dev on port 6001
✔ Channels are ready.
✔ Listening for redis events...
✔ Listening for http events...

Server ready!

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND http://new.wn.dev
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

Looks like its including the http or https is causing this issue:

http://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound

from laravel-echo-server.

Thaars avatar Thaars commented on July 20, 2024

I'm using MAMP to manage my hosts, so a non-port-80-request is not handled by MAMP. That means, the dns record doesn't exist. But Node is checking for the existence and throws an error.

The Server.serverProtocol() method is setting the secure flag by checking the host option. Without https:// in the host option, it will always start a http server.

I changed the condition to (this.options.protocol == 'https') to determine if a http or a https server should be used. The https:// prefix is not needed in the host option anymore.

That works for me.

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on July 20, 2024

@Thaars

Just confirming you mean you changed this line https://github.com/tlaverdure/laravel-echo-server/blob/master/src/server.ts#L49

To

if (this.options.protocol == 'https') {

Then you dropped using any protocol in the json file for the host key so it looks like this?

{
        "appKey": "",
        "authEndpoint": "/broadcasting/auth",
        "authHost": "http://example.com",
\\<snip>
        "devMode": false,
        "host": "example.com",
        "port": "6001",
        "protocol": "http"
}

Thanks!

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on July 20, 2024

Although I wrote it wrong above, (now fixed) that's actually what I meant in the first place! 😆

Thank you!

from laravel-echo-server.

pderiy avatar pderiy commented on July 20, 2024

@jonnywilliamson can you add PR?

from laravel-echo-server.

pderiy avatar pderiy commented on July 20, 2024

@tlaverdure this answer fixed my issue. Can you apply these changes?

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on July 20, 2024

@pderiy Sure #46

from laravel-echo-server.

tlaverdure avatar tlaverdure commented on July 20, 2024

Merge. @pderiy let me know if that closes this.

from laravel-echo-server.

pderiy avatar pderiy commented on July 20, 2024

It works great. Thank you guys.

@tlaverdure , @jonnywilliamson

from laravel-echo-server.

kokokele avatar kokokele commented on July 20, 2024

you havenot host for '127.0.0.1 localhost'

from laravel-echo-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.