GithubHelp home page GithubHelp logo

Comments (16)

Akhawais avatar Akhawais commented on August 29, 2024 1

Hey there, I found out that there was a function that was hanging in the then() closure. I've removed that and now Pawl is working fine.

Although I don't understand why it hangs in the test setup that I did, which doesn't have any functions in the closure.

Anyway, my issue is resolved with the main code. Thanks guys.

from pawl.

mbonneau avatar mbonneau commented on August 29, 2024

@Akhawais - I just created a new project using the simple example in the README and was able to connect to ws://echo.socketo.me:9000 and get the echoed text.

I am using php 7.0.5 with Pawl version 0.2.2. Could you post a gist of your code?

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

Sure https://gist.github.com/Akhawais/7e2a55125e246ccdf92bf6191bd6a573 @mbonneau

from pawl.

mbonneau avatar mbonneau commented on August 29, 2024

I just pasted that code into my project (I changed the require path but that is it) and it worked fine for me. I am not sure what would cause that to fail unless you are behind a firewall or proxy of some sort.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

Not sure why it's failing either. Ratchet was working fine 2 days ago. I'm able to connect to WS via other clients on the same machine and even trying Ratchet on a different machine and internet connection doesn't work.

from pawl.

mbonneau avatar mbonneau commented on August 29, 2024

Here is the output of my composer info - maybe there is some underlying library version that is different?

evenement/evenement v2.0.0  Événement is a very simple event dispatching library for PHP
guzzlehttp/psr7     1.3.1   PSR-7 message implementation
psr/http-message    1.0.1   Common interface for HTTP messages
ratchet/pawl        v0.2.2  Asynchronous WebSocket client
ratchet/rfc6455     v0.2.1  RFC6455 WebSocket protocol handler
react/cache         v0.4.1  Async caching.
react/dns           v0.4.3  Async DNS resolver.
react/event-loop    v0.4.2  Event loop abstraction layer that libraries can use for evented I/O.
react/http          v0.4.1  Library for building an evented http server.
react/http-client   v0.4.10 Asynchronous HTTP client library.
react/promise       v2.4.1  A lightweight implementation of CommonJS Promises/A for PHP
react/socket        v0.4.3  Library for building an evented socket server.
react/socket-client v0.5.0  Async connector to open TCP/IP and SSL/TLS based connections.
react/stream        v0.4.3  Basic readable and writable stream interfaces that support piping.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

composer info showing the exact same versions as yours.

from pawl.

mbonneau avatar mbonneau commented on August 29, 2024

What type of event loop is react using? You can find out like this:

<?php

require_once __DIR__ . '/vendor/autoload.php';

use React\EventLoop\Factory;

echo get_class(Factory::create()) . "\n";

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

React\EventLoop\StreamSelectLoop

from pawl.

mbonneau avatar mbonneau commented on August 29, 2024

That is what mine is using and should work fine. I am not sure what to try next - if you would like to post a packet capture of the attempted connection, I would be willing to look at it - or maybe someone else knows what is going on.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

Okay. What's really weird is the HTTP response that it outputs, I have no idea what server it's getting that from. Anyway, I'll try a bunch of things - maybe reinstalling Ratchet or trying a third machine - and if it still doesn't work then I'll do what you suggested.

Thanks for you help though. Appreciate it.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

Reinstalling Ratchet/3rd machine didn't work. Also tried a bare ratchet installation in a different directory which didn't work either.

@mbonneau Could you direct me on how to do a packet capture? If it helps, I've posted what seems like the HTTP response which gets outputted.

Thanks.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

If it helps, I'm using Google DNS and it still doesn't work.

On close event, I get this: Code: 1006 - Underlying connection closed

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

Just a follow up on this:

I have setup a simple node.js websocket proxy on the same machine I am running Pawl with. Just relays the socket data between Pawl and the actual Ws server.

For some reason, this allows Pawl to connect to any websocket server (e.g. echo.socketo.me:9000 or echo.websocket.org) but using Pawl directly with those servers fails with 1006 - Underlying connection closed

Any ideas?

from pawl.

cboden avatar cboden commented on August 29, 2024

Very strange. Sounds like it could be some kind of firewall blocking? I ran your gist on a fresh install of Pawl and had no problems.

from pawl.

Akhawais avatar Akhawais commented on August 29, 2024

I did try without any firewall running and that didn't work either.

I tried today connecting directly to the websocket server and it did successfully connect after 5 minutes of leaving it running. I don't believe that's caused by an issue with the particular server because the same delay occurs for echo.websocket.org.

The server in question (that I use Pawl mainly for) is irc-ws.chat.twitch.tv

I did notice that echo.socketo.me which is on port 9000 connects instantly however Twitch and websocket.org's echo are both on port 80.

That being said, I can still use a different client on the same machine to connect to Twitch instantly which is why I think it's Pawl and not a firewall (although this does look like a firewall issue)

I'll double check all my firewall rules and report back though.

Thanks for your time.

from pawl.

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.