socketo.me | Ratchet's Website | Web Site library
kandi X-RAY | socketo.me Summary
kandi X-RAY | socketo.me Summary
Ratchet's Website
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of socketo.me
socketo.me Key Features
socketo.me Examples and Code Snippets
Community Discussions
Trending Discussions on socketo.me
QUESTION
I am having problems with connecting my sockets
I am using Rachet and the guide provided by them http://socketo.me/docs/push for a simple push and pull sockets , but upon trying to connect my push socket I am given ZMQSocketException: Failed to connect the ZMQ: Protocol not supported
this is my controller code where i try to connect the socket
...ANSWER
Answered 2021-Mar-16 at 12:40The error I think is caused by having two ::
in this line. Please use the following line which has only one.
QUESTION
I'm creating a chat application using Ratchet Websocket. I followed their Hello World tutorial here: http://socketo.me/docs/hello-world
When I try to assign the data of received messages through a global function or variable, I get the error:
"ERROR TypeError: Cannot read property 'recievedMessage' of undefined at onMessage_callback (dashboard.component.ts:32) at WebSocket.conn.onmessage [as __zone_symbol__ON_PROPERTYmessage]"
I have read many other posters with the same issues but I cant figure out how to get their answers to work like they say. I am trying to add sent and received messages to a global array so I can display them all in a chat list. I know my problem has something to do with the scope of this.conn.onmessage=function(e)
but this is the first time I have used websockets or seen this syntax.
Why cant I call this.recievedMessage(data);
from function onMessage_callback(data);
?
Similar question (It even mentions you can assign data from callback to a global variable but this does not work for me): WebSocket returns undefined in code but not in console
I know all my backend client/chat php is working correctly due to the console showing messages for different connections.
typescript code:
...ANSWER
Answered 2020-Aug-07 at 20:08The context for this
changed when you are inside another function (onMessage_callback), so this
is no longer referring to the parent object at this point.
TO use the reference this
to the main class you must wrap this reference in another local variable (in this example, self
)
QUESTION
So I started using Ratchet (library to program and use a websocket server in PHP, http://socketo.me/docs/hello-world) to program a chat application on my website (on the web server itself).
I set it all up on my localhost and it all works. Now I wanna deploy it on my web server, which is an Apache Server. For this to work, I apparently need to configure a reverse proxy, ideally with NGINX, in front of my web server, because the websocket server cannot simply listen on the same port as my Apache server.
When searching for sources which explain how to configure a reverse proxy with NGINX in front of my Apache web server, search results / articles / tutorials always tell me how to configure a reverse proxy using NGINX on an Apache WebServer ON UBUNTU. I'm confused why Ubuntu always comes into play here; isn't it simply possible to configure an NGINX reverse proxy in front of my Apache web server, without the use of Ubuntu?
UPDATE
My server is a web server on a shared hosting basis, and I have no root access. So is it actually even possible to place a reverse proxy in front of my web server, given that I can't even change to which port my web server listens..?
To may describe in a better way what EXACTLY I want: A specific page of my website should load its content (html structure, representing a chat window) from the web server, but its chat functionality, present as PHP Ratchet script on the server-side, should work via a WebSocket connection. In other words, for this page, Web Server and WebSocket connections should work simultaneously, while I have only one Apache server, on a shared hosting basis, with no root access, on which both the chat application programmed in Ratchet and the website's HTML page are present (at least on my localhost, this worked very nicely). Is that even possible to deploy given my hosting conditions, or do I need to switch to another hosting type?
Also, please don't consider this question to be specific to nginx. According to the documentation in Ratchet, the solutions I have are:
Run web site and WebSocket server on the same machine using port 8080 for WebSockets and take the chance client proxies won't block traffic
Run WebSocket server on its own server on port 80 under a subdomain (sock.example.com)
Put a reverse proxy (Nginx, HAProxy, Varnish) in front of your web server and WebSocket server
I also figured out (github)
- Use the mod_proxy_wstunnels extension available for Apache
I'm more than happy to know about any of the four or other recommended solution, even if this wouldn't include nginx.
...ANSWER
Answered 2020-May-19 at 16:58Following the UPDATE section: We'll assume that you can't place a reverse proxy in front of your hosted solution within the hosting solution itself. That seems very unlikely.
My best bet would be to setup a reverse proxy on a dedicated VPS and pass all your trafic through this but this setup is far more convoluted than you probably require.
From the line "[...] on my web server, which is an Apache Server." I guess you are using a mutualized hosting solution. In which case, it'll depend heavily on which specific host you are using. In your CPannel try to look for "reverse proxy"/"proxy"/"socket"/"web socket" parameters.
If you're hosting on VPS and your distribution of linux of the "family" as ubuntu, follow a tutorial and it might just work. Otherwise, look for a tutorial specific to your distribution (or OS if you're not on linux).
QUESTION
I SSH'd to my server and installed Composer and Ratchet. http://socketo.me/docs/install claims all I need to do now is include "require DIR . '/vendor/autoload.php';" at the top of my php file. My page now gets a "failed to open stream: No such file or directory" error.
I've tried various forms of the directory, like "../vendor/autoload.php", but I keep getting the same error. The error reports that it is trying to find it in "/var/www/html/mo/myDomainName.com".
Should I be able to find a vendor folder in my home directory via ftp? I am confused where I'm supposed to be pointing to after my install.
...ANSWER
Answered 2020-Apr-03 at 20:26typically vendor folder for composer is located above /public_html, so if your script is in public_html folder, you'll have to reference this as up one level
example
QUESTION
I am running a Ratchet WebSocket for PHP (http://socketo.me/). It works fine at my localhost (WAMP), I have to run it via command line php chat-server.php and it works well. I have uploaded the website on a cloud based VPS, now I have to log into the VPS with the help of Putty on my laptop and then I run the same command again it works fine, as it starts listening to a opened port and sends out responses to the clients connected with that port. My issue is, as soon my laptop is offline the chat-server.php does not work anymore, it does not listen to the port and neither does it give out responses. My question is what could be a descent way to run chat-server.php so that even when the putty terminal (laptop) is offline it may still work. Any help is highly appreciated.
...ANSWER
Answered 2020-Feb-20 at 03:19I got the answer from Ratchet community at GitHub. Here is the link https://github.com/ratchetphp/Ratchet/issues/783#issuecomment-588528879 It worked for me.
Cracks of the answer is, we do it through daemon. Best
QUESTION
I try to run my websocket server but it fails to run for some reason I cant figure out. I used this tutorial: http://socketo.me/docs/hello-world
I have this main folder: enter image description here
composer.js:
...ANSWER
Answered 2020-Feb-02 at 15:39You are require
-ing the vendor/autoload.php
file after use
-ing the classes.
Put the require __DIR__ . '/vendor/autoload.php';
at the top of the file and PHP will be able to find the classes.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install socketo.me
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page