-
Notifications
You must be signed in to change notification settings - Fork 34
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
Need help regarding vue.js part in blade file #26
Comments
Hi @tayyab2020, Thanks for your compliments. You should try this, it will might help you. https://stackoverflow.com/questions/42262007/hiding-vue-js-template-before-it-is-rendered Thanks, |
Hi @sagarankoliya, I already implemented this. Now you are using raw MySQL queries through sockets, but I want to implement API endpoints or requests so I can use Laravel eloquent queries at backend. Can you guide me or point be towards any article so I can implement it. |
Hi @tayyab2020, Queries are already in nodejs back-end, and all features are attracted to nodejs sockets event, if you want to move queries on laravel then you have to change whole structure, and might some features will not work after your changes. Thanks, |
Hi @sagarankoliya, |
Hi @tayyab2020, I didn't understand what you want to achieve, all the things are real-time and laravel does not support real-time that's why all chat related queries are on nodejs side, so you can not move real-time data to leravel queries. Thanks, |
I am using sockets. What I did is I replaced your MySQL raw queries with API calls to my Laravel application. Of course the requests and responses are still in real-time environment. For example this function from helper.js This function fetches chats list of a user. Commented part was MySQL raw query and I replaced it will API request using AXIOS. And at backend I am using Laravel eloquent to fetch from MySQL server. Response is same in both cases and both are Promise based requests. |
Hi @tayyab2020, I got your point, it is simple just create api with api key in laravel and just call laravel api with axios in nodejs side. Thanks, |
Hi @sagarankoliya, The page at 'https://domain.com/chat' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://185.220.174.***:3000/socket.io/?id=%201&EIO=3&transport=polling&t=OO3L8YT'. This request has been blocked; the content must be served over HTTPS. While I have already defined origin: "https://domain.com" in nodejs/index.js file for CORS. |
Hi @tayyab2020, What is your WS_URL env value? It will be nodejs server url, you have run nodejs on https domain, becouse https does not allow to call http request outside. Thanks, |
Its server IP:PORT |
But my server IP is not SSL certified |
Do you know about wss:// protocol? I think instead of using http,https let the server handle protocol would be better option. |
I don't know about wss, sorry |
Can I use domain as WS_URL? |
Yes as per my knowledge you can. |
How can I run node server on my domain using port 3000 or any other port? |
Hi @sagarankoliya, |
Hi @tayyab2020, Which web server are you using? Setup domain for nodejs, If are you using nginx then add one location in vhost and proxy pass this location to ip port of nodejs server. Thanks, |
Hi @sagarankoliya, var socket = io(WS_URL, { query: "id= "+user_id, transports : ['websocket'] }); But now sometime it stops working all of a sudden., as the web server cant connect to websocket. Also I read somewhere that transports : ['websocket'] in socket.io is not a reliable solution. |
Hi, First of all I like your approach towards building this Realtime chat application. I need some guidance as I have implemented this in my Laravel application with my own custom chat template. I want to know that when a blade view is loaded with Vue.js variables or objects in it than the page first loads at client-side so it renders Vue.js variables for example like this "{{ chatList.name }}" until the Websocket running on Node.js server is executed and pulled data through query. It shows is just for few milliseconds or 1 sec but can I hide it or hide whole component until data is fetched from server and assigned to Vue.js variables?
The text was updated successfully, but these errors were encountered: