I am new to the Websocket world. I have implemented 2 API's one for getting the comments and one for posting the comments to a post. Using the following technologies.
Laravel 5.7
http://socketo.me/
Vue + Echo
Following https://www.youtube.com/playlist?list=PLwAKR305CRO9rlj-U9oOi4m2sQaWN6XA8
The above WebSockets are working fine with browser to browser in Axios calls, my question is how can I write WebSockets for Android/iOS developers and test like we do for API's and use postman for testing.
I have looked into iOS developer code they were using something like ws://123.123.123.123/socket Please guide how can I convert my WebSockets as ws: and deploy to stage server?
How to make a WebSocket on the above-mentioned technologies that iOS/Android developers can use directly?
I am sure my question looks basic, guidance can change it :-)
I want to send coordinates(lat,lng) from one device to another device as the location of the rider. If I am not wrong one device will push and another device will listen?
How can I write those WebSockets calls?
Related
I want to add real-time chat with notifications to my Laravel project.
How can I do that and also save the chats in MySQL? Is there any chat framework that I can use??
Because the best way to implement a chat uses websockets, which are not supported by default in PHP you need a service like pusher or running a Laravel Echo server which is based on socket.io (a Node JS lib).
Pusher is something like "websockets as a service" and has a tutorial: https://blog.pusher.com/how-to-build-a-laravel-chat-app-with-pusher/
And then there is this demo:
https://github.com/jplhomer/laravel-realtime-chat-demo
If you cannot run or pay for any of the previously mentioned websocket implementations, you could consider using long polling in javascript, but that is a worse solution. It takes more resources and works far less better.
Web Chat Application using Long-Polling Technology with PHP,MySQL and jQuery
I am working on a little personal project on Ionic2 framework, and one part of my application requires a chat to be implemented. So I went and read about Socket.IO and it's implementations and it is really awesome. But the drawback for my project is that the frontend will not be able to host NodeJS, so I had to quit the idea of using Socket.io.
is there any alternative/Solution to make the PHPserver maintain a bidirectional connection for the chat? My guessing was to use GET/POST between the Ionic App and the server but that will be heavy on both client and server since it has to check on every short amount of time (less than a second to give the real-time like behavior).
Thank you.
Recently I started working on web applications. Sorry if this is silly question.
I had an Android app earlier. I was using GCM for push notifications. Recently I have developed a web app using PHP for this application. I should notify the user when he receives new messages,alerts etc..
I read many blogs and learned that using WebSockets is the good solution.
So my question is
Is using Websockets a good solution ? Do I have any other good alternative?
How to use WebSockets here? Do I need to send request to Apache server for every interval after user login ? If yes what is the recommended value for interval? (please help me with sample example if possible)
Can I use WebSockets in shared hosting?
I am building a simple app with Laravel 4 as backend, Angular JS as frontend and MySql.
So far, i am using long polling for any update in database, for this i have to fire $http request from client to server after every 5 minutes.
I need something like Push Notifications which notify a client server that there is an update in database from server side.
I've searched a lot of things but just found Push Notification for Android and iOS only.
Is there any Library or Method available to implement Push Notification for Angular JS in Laravel 4?
Help Please, It would be appreciated.
The best solution would be to use WebSockets. I suggest using Ratchet (WebSockets for PHP). There is also the problem of WebSockets browser support which you need to take into consideration (but that can be overcome by using the websocket.js polyfill).
I was looking at Kanaka's reply to a websockets question here.
If I want to write a native app in PHP to use a websocket based webservice, where do I start? Are there any client libraries available in PHP to write native linux clients?
Basically, my server can work on a RESTful architecture for 90% of the time. However, there is one reason for the server to alert the client, so REST won't work here. So I am wondering if websockets is an answer here for me as compared to periodic polling by client.
Why not write the 90% using normal REST and do the remaining part where notifications are sent to the client using web sockets?
Here is a github project that looks like it might be what you want https://github.com/nicokaiser/php-websocket