Comments (12)
Sorry for delay in replying. I was doing some tests because I appeared again the error mentioned at the beginning of the issue:
The service "gos_web_socket.router.wamp" has a dependency on a non-existent service "gos_pubsub_router.websocket".
My mistake was that they did not include the bundle pubsub to AppKernel.php. Now that the server did worked properly, i.e. the error disappeared.
But now my problem is that when I define a route in my AppBundle / Resources / config / pubsub / routes.yml file as follows:
app_topic_chat:
channel: app/chat/{user_id}
handler:
callback: 'app.topic'
requirements:
user_id:
pattern: "\d+"
And when I use this code in the client's view (chat.html.twig):
var websocket = WS.connect("ws://127.0.0.1:8080");
myWebSocket.on("socket/connect", function(session){
session.subscribe("app/chat/32", function(uri, payload){
console.log("Received message", payload.msg);
});
console.log("Successfully Connected!");
})
myWebSocket.on("socket/disconnect", function(error){
console.log("Disconnected for " + error.reason + " with code " + error.code);
})
I have the following error:
ERROR: Unable to find route for app/chat/32
I don`t understand how to define correctly the routes for this.
I have also defined a Topic class with getName () appropriate (return 'app.topic '; ) and i configure this Topic as a service. I have also configured the bundle WebSocketBundle this:
gos_web_socket:
server:
host: 127.0.0.1
port: 8080
router:
resources:
- @AppBundle/Resources/config/pubsub/routing.yml
Could you give me a clue as to clearly define these routes ?. Because of that I'm lost
Thanks for you patience
from websocketbundle.
Thank you for reporting it. I think I must start to tag pubsub router to avoid this.
First you don't need to install pubsub router by yourself because he is already loaded by websocket bundle & configured (you just have to add your routing file).
I will fix it as soon as possible
from websocketbundle.
Thank you very much for your quick response. I will be aware
from websocketbundle.
I have released v1.0.2, run composer update, it should solved it ! :)
BTW, if you continue the installation until the routing configuration it work.
from websocketbundle.
It worked perfectly. Thank you very much again for your help. The bundle is excellent
from websocketbundle.
The bundle is excellent
Thank you very much !
from websocketbundle.
How do I make so you can use the routes with the bundle PubSubRouter? Because if I set routes through the option "router" I'm aking the same problem, ie I get the same error. Otherwise, how could do to dispense with this bundle (PubSubRouter)?
from websocketbundle.
Sorry but i don't understand :(
WebsocketBundle forward all configs under "router" key to "PubSubRouter" in order to keep the installation very easy.
Here an example : https://github.com/ProPheT777/real_time_bidirectional_notification-symfony2-redis-websocket-pubsub/commits?author=ProPheT777
-> May be the doc is wrong ?
from websocketbundle.
My mistake was that they did not include the bundle pubsub to AppKernel.php. Now that the server did worked properly, i.e. the error disappeared.
Nice catch, I forgot to update this docs section, I fixed it.
For the second part, it can be a miss configuration.
You said that you have defined the routing definition in AppBundle / Resources / config / pubsub / routes.yml
and in your configuration you have
gos_web_socket:
server:
host: 127.0.0.1
port: 8080
router:
resources:
- @AppBundle/Resources/config/pubsub/routing.yml
According to your routing file name it should be :
gos_web_socket:
server:
host: 127.0.0.1
port: 8080
router:
resources:
- @AppBundle/Resources/config/pubsub/routes.yml
from websocketbundle.
I have created a demo project from scratch available here : https://github.com/GeniusesOfSymfony/WebsocketAppDemo
I got one issue and update the docs : When I register new routing file in config.yml I must clear cache for take it into account and make switch the container to NullRouter to WampRouter.
I hope that will help you.
from websocketbundle.
Thank you very much for the demo application. I resolved my problem. I was making a mistake by naming the route (it was "app / chat" and wrote "app / channel" on file "chat.html.twig"). He also helped me the change of PubSubRouter bundle (requeriments on the route can be empty). Forgive me for delay in reply and thank you very much again for your help. :)
P.S. Why could make inquiries half if needed?
from websocketbundle.
ok, nice to hear that :) !
Why could make inquiries half if needed?
I'm sorry but I don't understand what you mean.
from websocketbundle.
Related Issues (20)
- Connection auto closes right after first incomming message HOT 1
- Suggestion: Native TLS support HOT 5
- The service ".service_locator.VS38E50" has a dependency on a non-existent service "Gos\Bundle\WebSocketBundle\Pusher\Wamp\WampPusher". HOT 5
- How define route with parameter?
- After upgrading Symfony from 5.3.0 to 5.3.13, gos:wsb gives error when client attempts to subscribe to channel HOT 4
- Push Notifications from Server HOT 1
- Error using PdoSessionHandler with symfony 6 - "VirtualSessionStorage::start() must be compatible.." HOT 3
- Session Problem PDO HOT 5
- Error installing the bundle: Undefined array key "port" HOT 2
- Uncaught ReferenceError: GosSocket is not defined HOT 2
- Please provide documentation for using the symfony messenger component as a pusher HOT 2
- Update to support modern Autobahn version. HOT 8
- New authentication flow using JWT HOT 9
- Subscribe to topic on server HOT 2
- Connection in IPV6 HOT 1
- TopicPeriodicTimer doesn't see new connections
- TopicPeriodicTimer only registered for one Topic, wrongly cleared if any one Topic has zero connections HOT 1
- How can I send a message HOT 2
- error while installing (In GosWebSocketExtension.php line 276 Notice: Undefined index: port)
- The "Gos\Bundle\WebSocketBundle\Pusher\PusherRegistry" class is deprecated and will be removed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websocketbundle.