Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ws porotocol is open but client log ERR_CONNECTION_RESET #345

Open
doyoque opened this issue Aug 24, 2020 · 0 comments
Open

ws porotocol is open but client log ERR_CONNECTION_RESET #345

doyoque opened this issue Aug 24, 2020 · 0 comments

Comments

@doyoque
Copy link

doyoque commented Aug 24, 2020

I was developing real-time order features with Laravel framework. I've come from Ratchet implementation then I find out Thruway because it using WAMP2 and compatible with latest autobahn.js (I'm using this #96 as implementation in backend). Everything seems work in local development. Then the issue come in when we have an AWS ec2 as the server. We use nginx as demo server.

Here's the log when I run as artisan command in the server:

2020-08-24T12:43:28.8674370 debug      [Thruway\Peer\Router 11022] New router created
2020-08-24T12:43:28.8687710 info       [App\Http\Controllers\PusherController 11022] New client created
2020-08-24T12:43:28.8723740 info       [Thruway\Peer\Router 11022] Starting router
2020-08-24T12:43:28.8758080 info       [Thruway\RealmManager 11022] Got prehello...
2020-08-24T12:43:28.8760710 debug      [Thruway\RealmManager 11022] Creating new realm 'realm1'
2020-08-24T12:43:28.8779930 debug      [Thruway\RealmManager 11022] Adding realm 'realm1'
2020-08-24T12:43:28.8794390 debug      [App\Http\Controllers\PusherController 11022] Client onMessage: [Thruway\Message\WelcomeMessage]
2020-08-24T12:43:28.8796240 info       [App\Http\Controllers\PusherController 11022] We have been welcomed...
2020-08-24T12:43:28.8818260 info       [Thruway\Transport\RatchetTransportProvider 11022] Websocket listening on 0.0.0.0:9000
2020-08-24T12:43:28.8825020 info       [Thruway\Peer\Router 11022] Starting loop

I guess the server is already open the ws:// protocol. Also here's the client side code:

let conn = new autobahn.Connection({ url: 'ws://127.0.0.1:8080', realm: 'realm1' });
let merchId = $('#realtime_contents').data('merchantid');

conn.onopen = function (session) {
    function onevent(args) {
        sectionOrder(args[0].order, true);
        get_notification_number();
    }

    session.subscribe(merchId.toString(), onevent);
};

But then when I check out the devtool the client throws a error.
Screenshot from 2020-08-24 10-58-22

Is there's any misconfiguration or something wrong in my client code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant