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

Not working #9

Closed
ghost opened this issue May 29, 2019 · 7 comments
Closed

Not working #9

ghost opened this issue May 29, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented May 29, 2019

No description provided.

@ghost ghost closed this as completed May 29, 2019
@ghost
Copy link
Author

ghost commented May 29, 2019

Hello,

When I try to connect to the server, nothing happens.

Here's what I tested:

  Echo echo = new Echo({
    'broadcaster': 'socket.io',
    'client': IO.io,
    'host': "http://192.168.0.16:6001",
    'autoConnect': true
  });

void initState () {
    super.initState();
    echo.channel('public-channel').listen('TestEvent', (e) =>print(e));
  }

On the laravel-echo development server, I don't see any connecting events (everything works with JS).

@ghost ghost reopened this May 29, 2019
@adamanderson86
Copy link

Check out this https://github.com/rikulo/socket.io-client-dart/issues/28
I was having any issue and this fixed it

@ghost
Copy link
Author

ghost commented Jun 8, 2019

@adamanderson86

Hello,
This

Echo echo = new Echo({
  'broadcaster': 'socket.io',
  'client': IO.io('http://192.168.0.16:6001', <String, dynamic>{'transports': ['websocket']}),
  'host': "http://192.168.0.16:6001",
  'autoConnect': true
});

Does not work.

=> Class 'Socket' has no instance method 'call'.

I want to use Echo library, not socket.io, which is just the client if I understood correctly.

@bhargavsejpalindianic
Copy link

Having same issue it shows connected but Listener not working

@kakajansh
Copy link
Owner

kakajansh commented Jul 1, 2019

@dayfault @bhargavsejpalindianic Did you try creating Echo instance in initState as provided in example

void initState () {
  super.initState();

  Echo echo = new Echo({
    'broadcaster': 'socket.io',
    'client': IO.io,
    'host': 'http://192.168.0.16:6001'
  });

  echo.channel('public-channel').listen('TestEvent', (e) => print(e));
}

@bhargavsejpalindianic
Copy link

it just worked problem was in internal server thanks for quick response @kakajansh

@ghost
Copy link
Author

ghost commented Jul 1, 2019

@kakajansh
Hello.

Yes I tried to creating instance in initState, not working.
I can't see any event in Echo console, just

version 1.5.0

⚠ Starting server in DEV mode...

✔  Running at 0.0.0.0 on port 6001
✔  Channels are ready.
✔  Listening for http events...
✔  Listening for redis events...

Server ready!

Here is my laravel-echo-server.json :

{
	"authHost": "http://localhost",
	"authEndpoint": "/broadcasting/auth",
	"clients": [],
	"database": "redis",
	"databaseConfig": {
		"redis": {},
		"sqlite": {
			"databasePath": "/database/laravel-echo-server.sqlite"
		}
	},
	"devMode": true,
	"host": "0.0.0.0",
	"port": "6001",
	"protocol": "http",
	"socketio": {},
	"sslCertPath": "",
	"sslKeyPath": "",
	"sslCertChainPath": "",
	"sslPassphrase": "",
	"subscribers": {
		"http": true,
		"redis": true
	},
	"apiOriginAllow": {
		"allowCors": false,
		"allowOrigin": "",
		"allowMethods": "",
		"allowHeaders": ""
	}
}

I tried with an Android Studio lib, it works. Same with JavaScript lib.
But I need to use Flutter.

Edit1: I am using a VirtualBox machine on Manjaro Linux to host my Echo server. I don't think that's the problem, since as I said, I tried with other libs and it worked

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

3 participants