Thruway | PHP Client and Router Library | Websocket library

 by   voryx PHP Version: 0.6.1 License: MIT

kandi X-RAY | Thruway Summary

kandi X-RAY | Thruway Summary

Thruway is a PHP library typically used in Networking, Websocket applications. Thruway has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging Protocol) for Real-Time Application Messaging
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Thruway has a low active ecosystem.
              It has 662 star(s) with 115 fork(s). There are 47 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 23 open issues and 273 have been closed. On average issues are closed in 677 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Thruway is 0.6.1

            kandi-Quality Quality

              Thruway has 0 bugs and 0 code smells.

            kandi-Security Security

              Thruway has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Thruway code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Thruway is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Thruway releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              Thruway saves you 4778 person hours of effort in developing the same functionality from scratch.
              It has 10078 lines of code, 1072 functions and 141 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Thruway and discovered the below as its top functions. This is intended to give you an instant insight into Thruway implemented functionality, and help decide if they suit your requirements.
            • Process Hello message
            • Handles Hello authentication .
            • Checks if an action is authorized by a set of roles
            • Get the invocation message
            • Process invocation error .
            • Get all sessions
            • On HTTP request .
            • Process a subscribe message
            • Handle the start of the router .
            • Add a registration message to the procedure .
            Get all kandi verified functions for this library.

            Thruway Key Features

            No Key Features are available at this moment for Thruway.

            Thruway Examples and Code Snippets

            No Code Snippets are available at this moment for Thruway.

            Community Discussions

            QUESTION

            Laravel delete job once it fails
            Asked 2020-Apr-28 at 19:17

            I have a job that times out and once it fails it dispatches another one just like itself so that it can run infinitely and without overlapping. However the job that fails stays in the queue and gets re-tried so I eventually have more than one job running which breaks the whole purpose.

            Here is how I handle the failing of the job:

            ...

            ANSWER

            Answered 2019-Jul-04 at 21:08

            The reason why failed is not executed, it is only triggered when a job exceeds it's maximum tries. The flow looks something like this.

            Source https://stackoverflow.com/questions/56889099

            QUESTION

            Dart - filter array by json value
            Asked 2019-Sep-22 at 13:23

            I have this JSON response:

            ...

            ANSWER

            Answered 2019-Sep-22 at 13:23

            QUESTION

            I'm having trouble loading my csv from Dropbox to RStudio Cloud. Can you please check what I'm doing wrong?
            Asked 2019-Apr-22 at 14:04

            I am trying to import a CSV from Dropbox into RStudio Cloud and it seems that RStudio is not reading the file correctly. The dataset has 7 columns, 5 million+ rows of toll collection data but the RStudio seems to be pulling something completely different.

            I downloaded the CSV from https://data.ny.gov/Transportation/NYS-Thruway-Origin-and-Destination-Points-for-All-/chzq-388p onto my computer and then uploaded the file to Dropbox. The Dropbox file link for the file is https://www.dropbox.com/s/y76m7r7wuzlj7oo/NYS_Thruway_Origin_and_Destination_Points_for_All_Vehicles_-_1_Hour_Intervals__2019%20%283%29.csv?dl=0.

            I have used both rempis and read.csv to load the file but RStudio is not reading the data set. Instead of the data set, RStudio Cloud is instead reading a file with two columns (row.names and X.Docutype).

            Using read.csv:

            ...

            ANSWER

            Answered 2019-Apr-22 at 14:04

            You need to find a better link. You can troubleshoot by using readLines("https://...") instead of read.csv (beware, don't dump the whole thing to the console, it's annoyingly big). The character vector is 211 long (for me), and the first few lines start with:

            Source https://stackoverflow.com/questions/55787464

            QUESTION

            Thruway manage subscriptions
            Asked 2018-May-07 at 17:50

            I try to set up a websocket server via Thruway which can manage multiple groups. Something like a chat application where each client may subscribe to one or multiple ones at the same time and broadcast messages to an entire chat room. I managed to do that with an ancient version of Ratchet but since it doesn't run very smooth, I wanted to switch to Thruway. Sadly I can't find anything to manage groups. So far I have the following as the websocket-manager and the clients are using the current version of Autobahn|js (18.x).

            Does anyone have any clue if it is possible to manage subscription groups with something like the following?

            ...

            ANSWER

            Answered 2018-May-07 at 17:50

            With ThruWay, things are a little different than old Ratchet. First of all Thruway is not a WAMP Server. It is just a router. So it doesn't have a server instance like old Rathcet has lets you wrap all your server side functionality wrapped up. But it will only get the message packet and will route them to other sessions in same realm depending on their subscriptions. If you ever used socket.io, realm idea is similar to different connections so you can limit your sessions or connections to a single namespace or split functionality of different socket instances like administration, visitors etc.

            On client side with autobahn ( latest version ) once you subscribe to a topic, then publish in that topic, thruway will automatically detect topic subscribers and emit message to them in same realm. But in old ratchet you need to handle this manually by keeping an array of available channels, and add users to each channel when they subscribes as well as broadcast message to these users in topic by iterating over them. This was really painful.

            If you want to use RPC calls in server side and don't want to include some of your stuff on client side, you can still use a class called internalClient on server side. Conceptually Internal Client is another session connects to your thruway client and handles some functions internally without exposing other clients. It receives message packages and does stuff in it then returns result back to requested client connection. It took a while for me to understand how it works but once I figured out the idea behind made more sense.

            so little bit code to explain better,

            In your router instance you will need to add a module, ( note that, in voxys/thruway package examples are little confusing about internal client )

            server.php

            Source https://stackoverflow.com/questions/50210887

            QUESTION

            How can i get this warn out from my project?
            Asked 2017-Nov-15 at 11:51

            How can I get rid of the following warning out in my project? My team doesn't have this warning like me.

            npm WARN @angular/compiler-cli@5.0.1 requires a peer of typescript@>=2.4.2 <2.5 but none is installed. You must install peer dependencies yourself.

            npm WARN angular2-daterangepicker@0.0.5 requires a peer of @angular/core@2.0.0 but none is installed. You must install peer dependencies yourself.

            npm WARN angular2-daterangepicker@0.0.5 requires a peer of bootstrap@^3.3.6 but none is installed. You must install peer dependencies yourself.

            npm WARN angular2-daterangepicker@0.0.5 requires a peer of jquery@^2.2.4 but none is installed. You must install peer dependencies yourself.

            npm WARN angular2-daterangepicker@0.0.5 requires a peer of rxjs@5.0.0-beta.6 but none is installed. You must install peer dependencies yourself.

            npm WARN angular2-daterangepicker@0.0.5 requires a peer of zone.js@^0.6.12 but none is installed. You must install peer dependencies yourself.

            npm WARN ng2-daterangepicker@2.0.12 requires a peer of @types/jquery@^3.2.12 but none is installed. You must install peer dependencies yourself.

            npm WARN thruway.js@1.2.13 requires a peer of ws@^2.2.1 but none is installed. You must install peer dependencies yourself.

            npm WARN tsickle@0.24.1 requires a peer of typescript@2.4.2 but none is installed. You must install peer dependencies yourself.

            ...

            ANSWER

            Answered 2017-Nov-15 at 11:51

            You can try updating all angular packages as follows:

            Source https://stackoverflow.com/questions/47303085

            QUESTION

            Real time chat in PHP +Redis +Pub/Sub +WebSockets (+NodeJS)
            Asked 2017-Mar-19 at 19:04

            I want to develop real time chat with channels and these are my needs:

            • PHP backend to manage site
            • Redis as session and data primary storage
            • Pub/Sub to send messages only to channel's interested users
            • one WebSocket connection with which the messages will be send and received.
            • (optional) NodeJS to use great npm packages like timesync or socket.io

            I see two different architectures to achieve this:

            • with Socket.io

            • with Crossbar.io

            These are my questions:

            1. Which architecture I should choose and why?
            2. The key is the user id cannot be obtained from client, because it can be malformed. So in the first architecture I think on every socket message I should attach PHPSESSID value from cookie and on sever-side retrieve PHP session from Redis. Am I right or there is better way to get user id?
            3. I wonder if getting user id in second architecture can be done differently?

            Edit:

            I choosed Crossbar.io, cause it is very powerful and allows to communicate many different language applications in real time. After studying examples, I come up with this:

            • On every login user have generated secret key in database.

            • PHP client (Thruway) connect to Crossbar server and register custom WAMP-CRA authenticator

            • User's browser connect to Crossbar server and is challenged. Secret and auth_id (user id) are loaded from DB with page load, so it can accomplish challenge and send response.

            • PHP authenticator search in DB for user with provided secret and id equal to auth_id. If there is, then it successfully authenticate session. Now we can trust that auth_id is real user id.

            These are my question:

            1. How I can get auth_id on subscribe?

            2. I also added cookie authentication and browser is remembered after authentication. But when I look in Chrome DevTools there is any cookie nor value in local storage. Even after clearing cache my browser is still remember by Crossbar. I wonder how it is possible?

            Edit2:

            Maybe I was misunderstood, but the main question was choosing appropriate architecture and getting trusted user id. There was no attention so I awarded bounty and after that I was downvoted. I read a lot about real-time apps and finally decided to use Crossbar.io, so I edited question to be related to it. Then people started upvoting, proposing another architectures, but not really answering my questions. After all I managed to do it myself and presented my answer.

            ...

            ANSWER

            Answered 2017-Mar-17 at 10:13

            PHP Ratchet is one of the best implementations I've used for real-time communications via WebSockets. Its based on ZMQ Sockets which is used in several online gaming applications and chat applications.

            The following examples will get you started pretty quick and will answer your questions around auth_id and subscriptions:

            http://socketo.me/docs/hello-world

            http://socketo.me/docs/push

            Overview of the Architecture:

            http://socketo.me/docs/push#networkarchitecture

            I would advice creating individual connections(toppics) per conversation as it doesn't really take a hit on performance and will add an additional layer of security per chat.

            Source https://stackoverflow.com/questions/42666799

            QUESTION

            How to parse message on server side with Thruway
            Asked 2017-Jan-06 at 22:24

            I want to use websocket for a voting application. There is two parts: one is a chat channel and an other one is a command channel where information about the question, the available answers, the countdown etc will travel.

            On the client side, I use Autobahn|JS as library. I can subscribe to my two channels easily (I can see it on server logs)

            On the server side, I use Thruway because it's WAMP v2 compliant.

            My problem: I don't know how I can hook the messages on the server side to broadcast them on each topics. Seems easy but I can find any solution.

            I guess it's by using InternalClient, but I am not really sure…

            Some code:

            JS Client

            ...

            ANSWER

            Answered 2017-Jan-06 at 22:24
            class TestInternalClient extends Thruway\Peer\Client {
            
                public function __construct() {
                    parent::__construct('com.test.dev');
                }
            
                public function onSessionStart($session, $transport) {
                    echo "--------------- Hello from InternalClient ------------\n";
            
                    $session->subscribe('chat.test', function ($args, $kwArgs, $options) use ($session) {
                        // Get message contents
                        $token = $args[0]->token;
                        $message = $args[0]->message;
            
                        // publish to other people
                        $session->publish('some.topic', [[ 'message' => $message ]]);
                    });
            
                    //////////////////////////////////////////
                    // Subscribe to everything in the system
                    $session->subscribe('', function ($args, $argsKw, $details, $publicationId) {
                        $value = isset($args[0]) ? $args[0] : '';
                        echo 'Received ' . json_encode($value) . ' on topic ' . $details->topic . PHP_EOL;
                    }, [ 'match' => 'prefix' ]);
                }
            }
            

            Source https://stackoverflow.com/questions/41448476

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Thruway

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/voryx/Thruway.git

          • CLI

            gh repo clone voryx/Thruway

          • sshUrl

            git@github.com:voryx/Thruway.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Websocket Libraries

            netty

            by netty

            ws

            by websockets

            websocket

            by gorilla

            websocketd

            by joewalnes

            koel

            by koel

            Try Top Libraries by voryx

            angular-wamp

            by voryxJavaScript

            PgAsync

            by voryxPHP

            ThruwayBundle

            by voryxPHP

            thruway.js

            by voryxTypeScript