├── .dockerignore ├── .github └── workflows │ ├── build.yaml │ └── release.yaml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── bin └── upstart │ └── xmr.conf ├── box.json ├── build.sh ├── composer.json ├── composer.lock ├── docker-compose.yml ├── entrypoint.sh ├── index.php ├── src ├── Controller │ ├── Api.php │ ├── Relay.php │ └── Server.php └── Entity │ ├── Display.php │ ├── Message.php │ └── Queue.php └── tests ├── Private API.http ├── cmsSend.php ├── key.pem ├── key.pub └── playerSub.php /.dockerignore: -------------------------------------------------------------------------------- 1 | config.json 2 | vendor/ 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - develop 8 | 9 | workflow_dispatch: 10 | 11 | jobs: 12 | build: 13 | name: Build 14 | if: github.repository == 'xibosignage/xibo-xmr' 15 | runs-on: ubuntu-22.04 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v1 19 | with: 20 | fetch-depth: 1 21 | 22 | - name: Login 23 | run: | 24 | docker login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} 25 | 26 | - name: Build Latest 27 | if: github.ref == 'refs/heads/master' 28 | run: | 29 | docker build . -t ghcr.io/xibosignage/xibo-xmr:latest 30 | docker push ghcr.io/xibosignage/xibo-xmr:latest 31 | 32 | - name: Build Develop 33 | if: github.ref == 'refs/heads/develop' 34 | run: | 35 | docker build . -t ghcr.io/xibosignage/xibo-xmr:develop 36 | docker push ghcr.io/xibosignage/xibo-xmr:develop 37 | 38 | - name: Build Release 39 | if: github.event_name == 'release' 40 | run: | 41 | docker build . -t ghcr.io/xibosignage/xibo-xmr:${GITHUB_REF##*/} 42 | docker push ghcr.io/xibosignage/xibo-xmr:${GITHUB_REF##*/} 43 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Build Tag 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | build: 10 | name: Build Containers 11 | if: github.repository == 'xibosignage/xibo-xmr' 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 1 18 | 19 | - name: Configure Build X 20 | uses: docker/setup-buildx-action@v3 21 | 22 | - name: Login to GitHub Container Registry 23 | uses: docker/login-action@v2 24 | with: 25 | registry: ghcr.io 26 | username: ${{ github.actor }} 27 | password: ${{ secrets.GITHUB_TOKEN }} 28 | 29 | - name: Build Image 30 | uses: docker/build-push-action@v5 31 | with: 32 | context: . 33 | cache-from: type=gha 34 | cache-to: type=gha,mode=max 35 | tags: ghcr.io/xibosignage/xibo-xmr:${{ github.ref_name }} 36 | build-args: GIT_COMMIT=${{ github.sha }} 37 | push: true 38 | load: false 39 | 40 | - name: Pull Image 41 | run: | 42 | docker pull ghcr.io/xibosignage/xibo-xmr:${GITHUB_REF##*/} 43 | 44 | - name: Build archive 45 | run: | 46 | CONTAINER=$(docker create ghcr.io/xibosignage/xibo-xmr:${GITHUB_REF##*/}) 47 | echo 'Copying PHAR from container.' 48 | docker cp "$CONTAINER":/opt/xmr/bin/xmr.phar xibo-xmr-${GITHUB_REF##*/} 49 | docker rm "$CONTAINER" 50 | 51 | - name: Release 52 | uses: softprops/action-gh-release@v1 53 | with: 54 | draft: true 55 | fail_on_unmatched_files: true 56 | files: | 57 | bin/xmr.phar 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | .idea/ 3 | bin/xmr.phar 4 | config.json -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer AS composer 2 | COPY . /app 3 | RUN composer install --no-interaction --no-dev --ignore-platform-reqs --optimize-autoloader 4 | 5 | # Build the PHAR file 6 | RUN echo 'phar.readonly = Off' > /usr/local/etc/php/php.ini; 7 | RUN curl -LSs https://github.com/box-project/box/releases/download/4.2.0/box.phar -o box.phar; php box.phar compile; rm box.phar 8 | 9 | FROM php:8.2-cli 10 | LABEL org.opencontainers.image.authors="Xibo Signage Ltd " 11 | 12 | ENV XMR_DEBUG=false 13 | ENV XMR_QUEUE_POLL=5 14 | ENV XMR_QUEUE_SIZE=10 15 | ENV XMR_IPV6PUBSUPPORT=false 16 | ENV XMR_RELAY_OLD_MESSAGES=false 17 | ENV XMR_RELAY_MESSAGES=false 18 | ENV XMR_SOCKETS_WS=0.0.0.0:8080 19 | ENV XMR_SOCKETS_API=0.0.0.0:8081 20 | ENV XMR_SOCKETS_ZM_PORT=9505 21 | 22 | RUN apt-get update && apt-get install -y libzmq3-dev git \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | RUN git clone https://github.com/zeromq/php-zmq.git \ 26 | && cd php-zmq \ 27 | && phpize && ./configure \ 28 | && make \ 29 | && make install \ 30 | && cd .. \ 31 | && rm -fr php-zmq 32 | 33 | RUN docker-php-ext-enable zmq 34 | 35 | EXPOSE 8080 8081 9505 36 | 37 | COPY ./entrypoint.sh /entrypoint.sh 38 | COPY . /opt/xmr 39 | COPY --from=composer /app/vendor /opt/xmr/vendor 40 | COPY --from=composer /app/bin /opt/xmr/bin 41 | 42 | RUN chown -R nobody /opt/xmr && chmod 755 /entrypoint.sh 43 | 44 | # Start XMR 45 | USER nobody 46 | 47 | CMD ["/entrypoint.sh"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | 663 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Xibo - Digital Signage - http://www.xibo.org.uk 3 | Copyright (C) 2006-2025 Xibo Signage Ltd and Contributors. 4 | 5 | This is the Xibo Message Relay (XMR) repository. 6 | 7 | XMR is a php application built on ReactPHP which acts as a ZeroMQ message exchange between the Xibo CMS and connected Xibo Players. It doesn't do anything beyond forward messages from the CMS to a pub/sub socket. 8 | 9 | It is packaged into a PHAR file which is included in the [Xibo CMS](https://github.com/xibosignage/xibo-cms) release files. 10 | 11 | **If you are here for anything other than software development purposes, it is unlikely you are in the right place. XMR is shipped with the Xibo CMS installation and you would usually install it from there.** 12 | 13 | 14 | 15 | ## Installation 16 | XMR can be run using Docker and Compose, for example: 17 | 18 | ```yaml 19 | version: "3" 20 | 21 | services: 22 | xmr: 23 | image: xibosignage/xibo-xmr:latest 24 | ports: 25 | - "9505:9505" 26 | - "50001:50001" 27 | ``` 28 | 29 | 30 | 31 | You may also build this library from source code: 32 | 33 | 1. Clone this repository 34 | 2. Run `./build.sh` 35 | 3. Run `docker-compose up --build` 36 | 37 | 38 | 39 | You may also reference this code in your own projects via Composer: 40 | 41 | ```bash 42 | composer require xibosignage/xibo-xmr 43 | ``` 44 | 45 | 46 | 47 | ### Ports 48 | 49 | XMR requires a listen address and a publish address and therefore needs 2 ports. The listen address is used for communication with the CMS (incoming comms) and the publish address is used for outgoing messages. 50 | 51 | When running in Docker, you will want to expose these ports to your machine OR connect your container to a Docker network which will facilitate communication with these ports. 52 | 53 | An example ports directive would be: 54 | 55 | ``` yaml 56 | ports: 57 | - "9505:9505" #Publish 58 | - "50001:50001" #Listen 59 | ``` 60 | 61 | 62 | 63 | 64 | 65 | ## Licence 66 | 67 | Xibo is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 68 | 69 | Xibo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 70 | 71 | You should have received a copy of the GNU Affero General Public License along with Xibo. If not, see . 72 | 73 | 74 | 75 | #### 3rd Party 76 | 77 | We use BOX to package the PHAR file - see https://github.com/box-project/box2 78 | -------------------------------------------------------------------------------- /bin/upstart/xmr.conf: -------------------------------------------------------------------------------- 1 | description "XMR Message Relay" 2 | 3 | start on runlevel [3] 4 | stop on runlevel [!2345] 5 | 6 | respawn 7 | 8 | script 9 | su -c "/usr/bin/php /opt/xmr/xmr.phar" -s /bin/sh nobody 10 | end script -------------------------------------------------------------------------------- /box.json: -------------------------------------------------------------------------------- 1 | { 2 | "chmod": "0755", 3 | "files": [ 4 | "LICENSE" 5 | ], 6 | "finder": [ 7 | { 8 | "name": "*.php", 9 | "exclude": ["tests"], 10 | "in": "vendor" 11 | } 12 | ], 13 | "main": "index.php", 14 | "output": "bin/xmr.phar", 15 | "stub": true, 16 | "force-autodiscovery": true 17 | } -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | docker run --rm --name xmr-build \ 3 | -v "$PWD":/usr/src/myapp \ 4 | -w /usr/src/myapp composer \ 5 | /bin/bash -c "echo 'phar.readonly = Off' > /usr/local/etc/php/php.ini; curl -LSs https://github.com/box-project/box/releases/download/4.2.0/box.phar -o box.phar; php box.phar compile; rm box.phar" 6 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xibosignage/xibo-xmr", 3 | "description": "Xibo Message Relay", 4 | "keywords": [ 5 | "xibo", 6 | "digital signage", 7 | "spring signage" 8 | ], 9 | "homepage": "https://xibosignage.com", 10 | "license": "AGPL-3.0-or-later", 11 | "authors": [ 12 | { 13 | "name": "Xibo Signage Ltd", 14 | "homepage": "https://xibosignage.com" 15 | }, 16 | { 17 | "name": "Xibo Contributors", 18 | "homepage": "https://github.com/xibosignage/xibo/tree/master/contributors" 19 | } 20 | ], 21 | "bin": ["bin/xmr.phar"], 22 | "config": { 23 | "platform": { 24 | "php": "8.2", 25 | "ext-zmq": "1" 26 | } 27 | }, 28 | "require": { 29 | "php": ">=8.2", 30 | "monolog/monolog": "^1.17", 31 | "react/react": "^1.4", 32 | "react/socket": "^1.16", 33 | "react/zmq": "^0.4.0", 34 | "cboden/ratchet": "^0.4.4", 35 | "guzzlehttp/guzzle": "^7.9" 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "Xibo\\": "src/" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "58cf90f353cd3f8d2862b0ebb1dff300", 8 | "packages": [ 9 | { 10 | "name": "cboden/ratchet", 11 | "version": "v0.4.4", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/ratchetphp/Ratchet.git", 15 | "reference": "5012dc954541b40c5599d286fd40653f5716a38f" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/5012dc954541b40c5599d286fd40653f5716a38f", 20 | "reference": "5012dc954541b40c5599d286fd40653f5716a38f", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzlehttp/psr7": "^1.7|^2.0", 25 | "php": ">=5.4.2", 26 | "ratchet/rfc6455": "^0.3.1", 27 | "react/event-loop": ">=0.4", 28 | "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", 29 | "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0|^6.0", 30 | "symfony/routing": "^2.6|^3.0|^4.0|^5.0|^6.0" 31 | }, 32 | "require-dev": { 33 | "phpunit/phpunit": "~4.8" 34 | }, 35 | "type": "library", 36 | "autoload": { 37 | "psr-4": { 38 | "Ratchet\\": "src/Ratchet" 39 | } 40 | }, 41 | "notification-url": "https://packagist.org/downloads/", 42 | "license": [ 43 | "MIT" 44 | ], 45 | "authors": [ 46 | { 47 | "name": "Chris Boden", 48 | "email": "cboden@gmail.com", 49 | "role": "Developer" 50 | }, 51 | { 52 | "name": "Matt Bonneau", 53 | "role": "Developer" 54 | } 55 | ], 56 | "description": "PHP WebSocket library", 57 | "homepage": "http://socketo.me", 58 | "keywords": [ 59 | "Ratchet", 60 | "WebSockets", 61 | "server", 62 | "sockets", 63 | "websocket" 64 | ], 65 | "support": { 66 | "chat": "https://gitter.im/reactphp/reactphp", 67 | "issues": "https://github.com/ratchetphp/Ratchet/issues", 68 | "source": "https://github.com/ratchetphp/Ratchet/tree/v0.4.4" 69 | }, 70 | "time": "2021-12-14T00:20:41+00:00" 71 | }, 72 | { 73 | "name": "evenement/evenement", 74 | "version": "v3.0.2", 75 | "source": { 76 | "type": "git", 77 | "url": "https://github.com/igorw/evenement.git", 78 | "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" 79 | }, 80 | "dist": { 81 | "type": "zip", 82 | "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", 83 | "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", 84 | "shasum": "" 85 | }, 86 | "require": { 87 | "php": ">=7.0" 88 | }, 89 | "require-dev": { 90 | "phpunit/phpunit": "^9 || ^6" 91 | }, 92 | "type": "library", 93 | "autoload": { 94 | "psr-4": { 95 | "Evenement\\": "src/" 96 | } 97 | }, 98 | "notification-url": "https://packagist.org/downloads/", 99 | "license": [ 100 | "MIT" 101 | ], 102 | "authors": [ 103 | { 104 | "name": "Igor Wiedler", 105 | "email": "igor@wiedler.ch" 106 | } 107 | ], 108 | "description": "Événement is a very simple event dispatching library for PHP", 109 | "keywords": [ 110 | "event-dispatcher", 111 | "event-emitter" 112 | ], 113 | "support": { 114 | "issues": "https://github.com/igorw/evenement/issues", 115 | "source": "https://github.com/igorw/evenement/tree/v3.0.2" 116 | }, 117 | "time": "2023-08-08T05:53:35+00:00" 118 | }, 119 | { 120 | "name": "fig/http-message-util", 121 | "version": "1.1.5", 122 | "source": { 123 | "type": "git", 124 | "url": "https://github.com/php-fig/http-message-util.git", 125 | "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" 126 | }, 127 | "dist": { 128 | "type": "zip", 129 | "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", 130 | "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", 131 | "shasum": "" 132 | }, 133 | "require": { 134 | "php": "^5.3 || ^7.0 || ^8.0" 135 | }, 136 | "suggest": { 137 | "psr/http-message": "The package containing the PSR-7 interfaces" 138 | }, 139 | "type": "library", 140 | "extra": { 141 | "branch-alias": { 142 | "dev-master": "1.1.x-dev" 143 | } 144 | }, 145 | "autoload": { 146 | "psr-4": { 147 | "Fig\\Http\\Message\\": "src/" 148 | } 149 | }, 150 | "notification-url": "https://packagist.org/downloads/", 151 | "license": [ 152 | "MIT" 153 | ], 154 | "authors": [ 155 | { 156 | "name": "PHP-FIG", 157 | "homepage": "https://www.php-fig.org/" 158 | } 159 | ], 160 | "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", 161 | "keywords": [ 162 | "http", 163 | "http-message", 164 | "psr", 165 | "psr-7", 166 | "request", 167 | "response" 168 | ], 169 | "support": { 170 | "issues": "https://github.com/php-fig/http-message-util/issues", 171 | "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" 172 | }, 173 | "time": "2020-11-24T22:02:12+00:00" 174 | }, 175 | { 176 | "name": "guzzlehttp/guzzle", 177 | "version": "7.9.2", 178 | "source": { 179 | "type": "git", 180 | "url": "https://github.com/guzzle/guzzle.git", 181 | "reference": "d281ed313b989f213357e3be1a179f02196ac99b" 182 | }, 183 | "dist": { 184 | "type": "zip", 185 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", 186 | "reference": "d281ed313b989f213357e3be1a179f02196ac99b", 187 | "shasum": "" 188 | }, 189 | "require": { 190 | "ext-json": "*", 191 | "guzzlehttp/promises": "^1.5.3 || ^2.0.3", 192 | "guzzlehttp/psr7": "^2.7.0", 193 | "php": "^7.2.5 || ^8.0", 194 | "psr/http-client": "^1.0", 195 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 196 | }, 197 | "provide": { 198 | "psr/http-client-implementation": "1.0" 199 | }, 200 | "require-dev": { 201 | "bamarni/composer-bin-plugin": "^1.8.2", 202 | "ext-curl": "*", 203 | "guzzle/client-integration-tests": "3.0.2", 204 | "php-http/message-factory": "^1.1", 205 | "phpunit/phpunit": "^8.5.39 || ^9.6.20", 206 | "psr/log": "^1.1 || ^2.0 || ^3.0" 207 | }, 208 | "suggest": { 209 | "ext-curl": "Required for CURL handler support", 210 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 211 | "psr/log": "Required for using the Log middleware" 212 | }, 213 | "type": "library", 214 | "extra": { 215 | "bamarni-bin": { 216 | "bin-links": true, 217 | "forward-command": false 218 | } 219 | }, 220 | "autoload": { 221 | "files": [ 222 | "src/functions_include.php" 223 | ], 224 | "psr-4": { 225 | "GuzzleHttp\\": "src/" 226 | } 227 | }, 228 | "notification-url": "https://packagist.org/downloads/", 229 | "license": [ 230 | "MIT" 231 | ], 232 | "authors": [ 233 | { 234 | "name": "Graham Campbell", 235 | "email": "hello@gjcampbell.co.uk", 236 | "homepage": "https://github.com/GrahamCampbell" 237 | }, 238 | { 239 | "name": "Michael Dowling", 240 | "email": "mtdowling@gmail.com", 241 | "homepage": "https://github.com/mtdowling" 242 | }, 243 | { 244 | "name": "Jeremy Lindblom", 245 | "email": "jeremeamia@gmail.com", 246 | "homepage": "https://github.com/jeremeamia" 247 | }, 248 | { 249 | "name": "George Mponos", 250 | "email": "gmponos@gmail.com", 251 | "homepage": "https://github.com/gmponos" 252 | }, 253 | { 254 | "name": "Tobias Nyholm", 255 | "email": "tobias.nyholm@gmail.com", 256 | "homepage": "https://github.com/Nyholm" 257 | }, 258 | { 259 | "name": "Márk Sági-Kazár", 260 | "email": "mark.sagikazar@gmail.com", 261 | "homepage": "https://github.com/sagikazarmark" 262 | }, 263 | { 264 | "name": "Tobias Schultze", 265 | "email": "webmaster@tubo-world.de", 266 | "homepage": "https://github.com/Tobion" 267 | } 268 | ], 269 | "description": "Guzzle is a PHP HTTP client library", 270 | "keywords": [ 271 | "client", 272 | "curl", 273 | "framework", 274 | "http", 275 | "http client", 276 | "psr-18", 277 | "psr-7", 278 | "rest", 279 | "web service" 280 | ], 281 | "support": { 282 | "issues": "https://github.com/guzzle/guzzle/issues", 283 | "source": "https://github.com/guzzle/guzzle/tree/7.9.2" 284 | }, 285 | "funding": [ 286 | { 287 | "url": "https://github.com/GrahamCampbell", 288 | "type": "github" 289 | }, 290 | { 291 | "url": "https://github.com/Nyholm", 292 | "type": "github" 293 | }, 294 | { 295 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 296 | "type": "tidelift" 297 | } 298 | ], 299 | "time": "2024-07-24T11:22:20+00:00" 300 | }, 301 | { 302 | "name": "guzzlehttp/promises", 303 | "version": "2.0.4", 304 | "source": { 305 | "type": "git", 306 | "url": "https://github.com/guzzle/promises.git", 307 | "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" 308 | }, 309 | "dist": { 310 | "type": "zip", 311 | "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", 312 | "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", 313 | "shasum": "" 314 | }, 315 | "require": { 316 | "php": "^7.2.5 || ^8.0" 317 | }, 318 | "require-dev": { 319 | "bamarni/composer-bin-plugin": "^1.8.2", 320 | "phpunit/phpunit": "^8.5.39 || ^9.6.20" 321 | }, 322 | "type": "library", 323 | "extra": { 324 | "bamarni-bin": { 325 | "bin-links": true, 326 | "forward-command": false 327 | } 328 | }, 329 | "autoload": { 330 | "psr-4": { 331 | "GuzzleHttp\\Promise\\": "src/" 332 | } 333 | }, 334 | "notification-url": "https://packagist.org/downloads/", 335 | "license": [ 336 | "MIT" 337 | ], 338 | "authors": [ 339 | { 340 | "name": "Graham Campbell", 341 | "email": "hello@gjcampbell.co.uk", 342 | "homepage": "https://github.com/GrahamCampbell" 343 | }, 344 | { 345 | "name": "Michael Dowling", 346 | "email": "mtdowling@gmail.com", 347 | "homepage": "https://github.com/mtdowling" 348 | }, 349 | { 350 | "name": "Tobias Nyholm", 351 | "email": "tobias.nyholm@gmail.com", 352 | "homepage": "https://github.com/Nyholm" 353 | }, 354 | { 355 | "name": "Tobias Schultze", 356 | "email": "webmaster@tubo-world.de", 357 | "homepage": "https://github.com/Tobion" 358 | } 359 | ], 360 | "description": "Guzzle promises library", 361 | "keywords": [ 362 | "promise" 363 | ], 364 | "support": { 365 | "issues": "https://github.com/guzzle/promises/issues", 366 | "source": "https://github.com/guzzle/promises/tree/2.0.4" 367 | }, 368 | "funding": [ 369 | { 370 | "url": "https://github.com/GrahamCampbell", 371 | "type": "github" 372 | }, 373 | { 374 | "url": "https://github.com/Nyholm", 375 | "type": "github" 376 | }, 377 | { 378 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 379 | "type": "tidelift" 380 | } 381 | ], 382 | "time": "2024-10-17T10:06:22+00:00" 383 | }, 384 | { 385 | "name": "guzzlehttp/psr7", 386 | "version": "2.7.0", 387 | "source": { 388 | "type": "git", 389 | "url": "https://github.com/guzzle/psr7.git", 390 | "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" 391 | }, 392 | "dist": { 393 | "type": "zip", 394 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", 395 | "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", 396 | "shasum": "" 397 | }, 398 | "require": { 399 | "php": "^7.2.5 || ^8.0", 400 | "psr/http-factory": "^1.0", 401 | "psr/http-message": "^1.1 || ^2.0", 402 | "ralouphie/getallheaders": "^3.0" 403 | }, 404 | "provide": { 405 | "psr/http-factory-implementation": "1.0", 406 | "psr/http-message-implementation": "1.0" 407 | }, 408 | "require-dev": { 409 | "bamarni/composer-bin-plugin": "^1.8.2", 410 | "http-interop/http-factory-tests": "0.9.0", 411 | "phpunit/phpunit": "^8.5.39 || ^9.6.20" 412 | }, 413 | "suggest": { 414 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 415 | }, 416 | "type": "library", 417 | "extra": { 418 | "bamarni-bin": { 419 | "bin-links": true, 420 | "forward-command": false 421 | } 422 | }, 423 | "autoload": { 424 | "psr-4": { 425 | "GuzzleHttp\\Psr7\\": "src/" 426 | } 427 | }, 428 | "notification-url": "https://packagist.org/downloads/", 429 | "license": [ 430 | "MIT" 431 | ], 432 | "authors": [ 433 | { 434 | "name": "Graham Campbell", 435 | "email": "hello@gjcampbell.co.uk", 436 | "homepage": "https://github.com/GrahamCampbell" 437 | }, 438 | { 439 | "name": "Michael Dowling", 440 | "email": "mtdowling@gmail.com", 441 | "homepage": "https://github.com/mtdowling" 442 | }, 443 | { 444 | "name": "George Mponos", 445 | "email": "gmponos@gmail.com", 446 | "homepage": "https://github.com/gmponos" 447 | }, 448 | { 449 | "name": "Tobias Nyholm", 450 | "email": "tobias.nyholm@gmail.com", 451 | "homepage": "https://github.com/Nyholm" 452 | }, 453 | { 454 | "name": "Márk Sági-Kazár", 455 | "email": "mark.sagikazar@gmail.com", 456 | "homepage": "https://github.com/sagikazarmark" 457 | }, 458 | { 459 | "name": "Tobias Schultze", 460 | "email": "webmaster@tubo-world.de", 461 | "homepage": "https://github.com/Tobion" 462 | }, 463 | { 464 | "name": "Márk Sági-Kazár", 465 | "email": "mark.sagikazar@gmail.com", 466 | "homepage": "https://sagikazarmark.hu" 467 | } 468 | ], 469 | "description": "PSR-7 message implementation that also provides common utility methods", 470 | "keywords": [ 471 | "http", 472 | "message", 473 | "psr-7", 474 | "request", 475 | "response", 476 | "stream", 477 | "uri", 478 | "url" 479 | ], 480 | "support": { 481 | "issues": "https://github.com/guzzle/psr7/issues", 482 | "source": "https://github.com/guzzle/psr7/tree/2.7.0" 483 | }, 484 | "funding": [ 485 | { 486 | "url": "https://github.com/GrahamCampbell", 487 | "type": "github" 488 | }, 489 | { 490 | "url": "https://github.com/Nyholm", 491 | "type": "github" 492 | }, 493 | { 494 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 495 | "type": "tidelift" 496 | } 497 | ], 498 | "time": "2024-07-18T11:15:46+00:00" 499 | }, 500 | { 501 | "name": "monolog/monolog", 502 | "version": "1.27.1", 503 | "source": { 504 | "type": "git", 505 | "url": "https://github.com/Seldaek/monolog.git", 506 | "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" 507 | }, 508 | "dist": { 509 | "type": "zip", 510 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", 511 | "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", 512 | "shasum": "" 513 | }, 514 | "require": { 515 | "php": ">=5.3.0", 516 | "psr/log": "~1.0" 517 | }, 518 | "provide": { 519 | "psr/log-implementation": "1.0.0" 520 | }, 521 | "require-dev": { 522 | "aws/aws-sdk-php": "^2.4.9 || ^3.0", 523 | "doctrine/couchdb": "~1.0@dev", 524 | "graylog2/gelf-php": "~1.0", 525 | "php-amqplib/php-amqplib": "~2.4", 526 | "php-console/php-console": "^3.1.3", 527 | "phpstan/phpstan": "^0.12.59", 528 | "phpunit/phpunit": "~4.5", 529 | "ruflin/elastica": ">=0.90 <3.0", 530 | "sentry/sentry": "^0.13", 531 | "swiftmailer/swiftmailer": "^5.3|^6.0" 532 | }, 533 | "suggest": { 534 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 535 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 536 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 537 | "ext-mongo": "Allow sending log messages to a MongoDB server", 538 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 539 | "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", 540 | "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", 541 | "php-console/php-console": "Allow sending log messages to Google Chrome", 542 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 543 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 544 | "sentry/sentry": "Allow sending log messages to a Sentry server" 545 | }, 546 | "type": "library", 547 | "autoload": { 548 | "psr-4": { 549 | "Monolog\\": "src/Monolog" 550 | } 551 | }, 552 | "notification-url": "https://packagist.org/downloads/", 553 | "license": [ 554 | "MIT" 555 | ], 556 | "authors": [ 557 | { 558 | "name": "Jordi Boggiano", 559 | "email": "j.boggiano@seld.be", 560 | "homepage": "http://seld.be" 561 | } 562 | ], 563 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 564 | "homepage": "http://github.com/Seldaek/monolog", 565 | "keywords": [ 566 | "log", 567 | "logging", 568 | "psr-3" 569 | ], 570 | "support": { 571 | "issues": "https://github.com/Seldaek/monolog/issues", 572 | "source": "https://github.com/Seldaek/monolog/tree/1.27.1" 573 | }, 574 | "funding": [ 575 | { 576 | "url": "https://github.com/Seldaek", 577 | "type": "github" 578 | }, 579 | { 580 | "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", 581 | "type": "tidelift" 582 | } 583 | ], 584 | "time": "2022-06-09T08:53:42+00:00" 585 | }, 586 | { 587 | "name": "psr/http-client", 588 | "version": "1.0.3", 589 | "source": { 590 | "type": "git", 591 | "url": "https://github.com/php-fig/http-client.git", 592 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" 593 | }, 594 | "dist": { 595 | "type": "zip", 596 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", 597 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", 598 | "shasum": "" 599 | }, 600 | "require": { 601 | "php": "^7.0 || ^8.0", 602 | "psr/http-message": "^1.0 || ^2.0" 603 | }, 604 | "type": "library", 605 | "extra": { 606 | "branch-alias": { 607 | "dev-master": "1.0.x-dev" 608 | } 609 | }, 610 | "autoload": { 611 | "psr-4": { 612 | "Psr\\Http\\Client\\": "src/" 613 | } 614 | }, 615 | "notification-url": "https://packagist.org/downloads/", 616 | "license": [ 617 | "MIT" 618 | ], 619 | "authors": [ 620 | { 621 | "name": "PHP-FIG", 622 | "homepage": "https://www.php-fig.org/" 623 | } 624 | ], 625 | "description": "Common interface for HTTP clients", 626 | "homepage": "https://github.com/php-fig/http-client", 627 | "keywords": [ 628 | "http", 629 | "http-client", 630 | "psr", 631 | "psr-18" 632 | ], 633 | "support": { 634 | "source": "https://github.com/php-fig/http-client" 635 | }, 636 | "time": "2023-09-23T14:17:50+00:00" 637 | }, 638 | { 639 | "name": "psr/http-factory", 640 | "version": "1.1.0", 641 | "source": { 642 | "type": "git", 643 | "url": "https://github.com/php-fig/http-factory.git", 644 | "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" 645 | }, 646 | "dist": { 647 | "type": "zip", 648 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", 649 | "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", 650 | "shasum": "" 651 | }, 652 | "require": { 653 | "php": ">=7.1", 654 | "psr/http-message": "^1.0 || ^2.0" 655 | }, 656 | "type": "library", 657 | "extra": { 658 | "branch-alias": { 659 | "dev-master": "1.0.x-dev" 660 | } 661 | }, 662 | "autoload": { 663 | "psr-4": { 664 | "Psr\\Http\\Message\\": "src/" 665 | } 666 | }, 667 | "notification-url": "https://packagist.org/downloads/", 668 | "license": [ 669 | "MIT" 670 | ], 671 | "authors": [ 672 | { 673 | "name": "PHP-FIG", 674 | "homepage": "https://www.php-fig.org/" 675 | } 676 | ], 677 | "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", 678 | "keywords": [ 679 | "factory", 680 | "http", 681 | "message", 682 | "psr", 683 | "psr-17", 684 | "psr-7", 685 | "request", 686 | "response" 687 | ], 688 | "support": { 689 | "source": "https://github.com/php-fig/http-factory" 690 | }, 691 | "time": "2024-04-15T12:06:14+00:00" 692 | }, 693 | { 694 | "name": "psr/http-message", 695 | "version": "1.1", 696 | "source": { 697 | "type": "git", 698 | "url": "https://github.com/php-fig/http-message.git", 699 | "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" 700 | }, 701 | "dist": { 702 | "type": "zip", 703 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", 704 | "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", 705 | "shasum": "" 706 | }, 707 | "require": { 708 | "php": "^7.2 || ^8.0" 709 | }, 710 | "type": "library", 711 | "extra": { 712 | "branch-alias": { 713 | "dev-master": "1.1.x-dev" 714 | } 715 | }, 716 | "autoload": { 717 | "psr-4": { 718 | "Psr\\Http\\Message\\": "src/" 719 | } 720 | }, 721 | "notification-url": "https://packagist.org/downloads/", 722 | "license": [ 723 | "MIT" 724 | ], 725 | "authors": [ 726 | { 727 | "name": "PHP-FIG", 728 | "homepage": "http://www.php-fig.org/" 729 | } 730 | ], 731 | "description": "Common interface for HTTP messages", 732 | "homepage": "https://github.com/php-fig/http-message", 733 | "keywords": [ 734 | "http", 735 | "http-message", 736 | "psr", 737 | "psr-7", 738 | "request", 739 | "response" 740 | ], 741 | "support": { 742 | "source": "https://github.com/php-fig/http-message/tree/1.1" 743 | }, 744 | "time": "2023-04-04T09:50:52+00:00" 745 | }, 746 | { 747 | "name": "psr/log", 748 | "version": "1.1.4", 749 | "source": { 750 | "type": "git", 751 | "url": "https://github.com/php-fig/log.git", 752 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11" 753 | }, 754 | "dist": { 755 | "type": "zip", 756 | "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", 757 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11", 758 | "shasum": "" 759 | }, 760 | "require": { 761 | "php": ">=5.3.0" 762 | }, 763 | "type": "library", 764 | "extra": { 765 | "branch-alias": { 766 | "dev-master": "1.1.x-dev" 767 | } 768 | }, 769 | "autoload": { 770 | "psr-4": { 771 | "Psr\\Log\\": "Psr/Log/" 772 | } 773 | }, 774 | "notification-url": "https://packagist.org/downloads/", 775 | "license": [ 776 | "MIT" 777 | ], 778 | "authors": [ 779 | { 780 | "name": "PHP-FIG", 781 | "homepage": "https://www.php-fig.org/" 782 | } 783 | ], 784 | "description": "Common interface for logging libraries", 785 | "homepage": "https://github.com/php-fig/log", 786 | "keywords": [ 787 | "log", 788 | "psr", 789 | "psr-3" 790 | ], 791 | "support": { 792 | "source": "https://github.com/php-fig/log/tree/1.1.4" 793 | }, 794 | "time": "2021-05-03T11:20:27+00:00" 795 | }, 796 | { 797 | "name": "ralouphie/getallheaders", 798 | "version": "3.0.3", 799 | "source": { 800 | "type": "git", 801 | "url": "https://github.com/ralouphie/getallheaders.git", 802 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 803 | }, 804 | "dist": { 805 | "type": "zip", 806 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 807 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 808 | "shasum": "" 809 | }, 810 | "require": { 811 | "php": ">=5.6" 812 | }, 813 | "require-dev": { 814 | "php-coveralls/php-coveralls": "^2.1", 815 | "phpunit/phpunit": "^5 || ^6.5" 816 | }, 817 | "type": "library", 818 | "autoload": { 819 | "files": [ 820 | "src/getallheaders.php" 821 | ] 822 | }, 823 | "notification-url": "https://packagist.org/downloads/", 824 | "license": [ 825 | "MIT" 826 | ], 827 | "authors": [ 828 | { 829 | "name": "Ralph Khattar", 830 | "email": "ralph.khattar@gmail.com" 831 | } 832 | ], 833 | "description": "A polyfill for getallheaders.", 834 | "support": { 835 | "issues": "https://github.com/ralouphie/getallheaders/issues", 836 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 837 | }, 838 | "time": "2019-03-08T08:55:37+00:00" 839 | }, 840 | { 841 | "name": "ratchet/rfc6455", 842 | "version": "v0.3.1", 843 | "source": { 844 | "type": "git", 845 | "url": "https://github.com/ratchetphp/RFC6455.git", 846 | "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb" 847 | }, 848 | "dist": { 849 | "type": "zip", 850 | "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/7c964514e93456a52a99a20fcfa0de242a43ccdb", 851 | "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb", 852 | "shasum": "" 853 | }, 854 | "require": { 855 | "guzzlehttp/psr7": "^2 || ^1.7", 856 | "php": ">=5.4.2" 857 | }, 858 | "require-dev": { 859 | "phpunit/phpunit": "^5.7", 860 | "react/socket": "^1.3" 861 | }, 862 | "type": "library", 863 | "autoload": { 864 | "psr-4": { 865 | "Ratchet\\RFC6455\\": "src" 866 | } 867 | }, 868 | "notification-url": "https://packagist.org/downloads/", 869 | "license": [ 870 | "MIT" 871 | ], 872 | "authors": [ 873 | { 874 | "name": "Chris Boden", 875 | "email": "cboden@gmail.com", 876 | "role": "Developer" 877 | }, 878 | { 879 | "name": "Matt Bonneau", 880 | "role": "Developer" 881 | } 882 | ], 883 | "description": "RFC6455 WebSocket protocol handler", 884 | "homepage": "http://socketo.me", 885 | "keywords": [ 886 | "WebSockets", 887 | "rfc6455", 888 | "websocket" 889 | ], 890 | "support": { 891 | "chat": "https://gitter.im/reactphp/reactphp", 892 | "issues": "https://github.com/ratchetphp/RFC6455/issues", 893 | "source": "https://github.com/ratchetphp/RFC6455/tree/v0.3.1" 894 | }, 895 | "time": "2021-12-09T23:20:49+00:00" 896 | }, 897 | { 898 | "name": "react/async", 899 | "version": "v4.3.0", 900 | "source": { 901 | "type": "git", 902 | "url": "https://github.com/reactphp/async.git", 903 | "reference": "635d50e30844a484495713e8cb8d9e079c0008a5" 904 | }, 905 | "dist": { 906 | "type": "zip", 907 | "url": "https://api.github.com/repos/reactphp/async/zipball/635d50e30844a484495713e8cb8d9e079c0008a5", 908 | "reference": "635d50e30844a484495713e8cb8d9e079c0008a5", 909 | "shasum": "" 910 | }, 911 | "require": { 912 | "php": ">=8.1", 913 | "react/event-loop": "^1.2", 914 | "react/promise": "^3.2 || ^2.8 || ^1.2.1" 915 | }, 916 | "require-dev": { 917 | "phpstan/phpstan": "1.10.39", 918 | "phpunit/phpunit": "^9.6" 919 | }, 920 | "type": "library", 921 | "autoload": { 922 | "files": [ 923 | "src/functions_include.php" 924 | ], 925 | "psr-4": { 926 | "React\\Async\\": "src/" 927 | } 928 | }, 929 | "notification-url": "https://packagist.org/downloads/", 930 | "license": [ 931 | "MIT" 932 | ], 933 | "authors": [ 934 | { 935 | "name": "Christian Lück", 936 | "email": "christian@clue.engineering", 937 | "homepage": "https://clue.engineering/" 938 | }, 939 | { 940 | "name": "Cees-Jan Kiewiet", 941 | "email": "reactphp@ceesjankiewiet.nl", 942 | "homepage": "https://wyrihaximus.net/" 943 | }, 944 | { 945 | "name": "Jan Sorgalla", 946 | "email": "jsorgalla@gmail.com", 947 | "homepage": "https://sorgalla.com/" 948 | }, 949 | { 950 | "name": "Chris Boden", 951 | "email": "cboden@gmail.com", 952 | "homepage": "https://cboden.dev/" 953 | } 954 | ], 955 | "description": "Async utilities and fibers for ReactPHP", 956 | "keywords": [ 957 | "async", 958 | "reactphp" 959 | ], 960 | "support": { 961 | "issues": "https://github.com/reactphp/async/issues", 962 | "source": "https://github.com/reactphp/async/tree/v4.3.0" 963 | }, 964 | "funding": [ 965 | { 966 | "url": "https://opencollective.com/reactphp", 967 | "type": "open_collective" 968 | } 969 | ], 970 | "time": "2024-06-04T14:40:02+00:00" 971 | }, 972 | { 973 | "name": "react/cache", 974 | "version": "v1.2.0", 975 | "source": { 976 | "type": "git", 977 | "url": "https://github.com/reactphp/cache.git", 978 | "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" 979 | }, 980 | "dist": { 981 | "type": "zip", 982 | "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", 983 | "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", 984 | "shasum": "" 985 | }, 986 | "require": { 987 | "php": ">=5.3.0", 988 | "react/promise": "^3.0 || ^2.0 || ^1.1" 989 | }, 990 | "require-dev": { 991 | "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" 992 | }, 993 | "type": "library", 994 | "autoload": { 995 | "psr-4": { 996 | "React\\Cache\\": "src/" 997 | } 998 | }, 999 | "notification-url": "https://packagist.org/downloads/", 1000 | "license": [ 1001 | "MIT" 1002 | ], 1003 | "authors": [ 1004 | { 1005 | "name": "Christian Lück", 1006 | "email": "christian@clue.engineering", 1007 | "homepage": "https://clue.engineering/" 1008 | }, 1009 | { 1010 | "name": "Cees-Jan Kiewiet", 1011 | "email": "reactphp@ceesjankiewiet.nl", 1012 | "homepage": "https://wyrihaximus.net/" 1013 | }, 1014 | { 1015 | "name": "Jan Sorgalla", 1016 | "email": "jsorgalla@gmail.com", 1017 | "homepage": "https://sorgalla.com/" 1018 | }, 1019 | { 1020 | "name": "Chris Boden", 1021 | "email": "cboden@gmail.com", 1022 | "homepage": "https://cboden.dev/" 1023 | } 1024 | ], 1025 | "description": "Async, Promise-based cache interface for ReactPHP", 1026 | "keywords": [ 1027 | "cache", 1028 | "caching", 1029 | "promise", 1030 | "reactphp" 1031 | ], 1032 | "support": { 1033 | "issues": "https://github.com/reactphp/cache/issues", 1034 | "source": "https://github.com/reactphp/cache/tree/v1.2.0" 1035 | }, 1036 | "funding": [ 1037 | { 1038 | "url": "https://opencollective.com/reactphp", 1039 | "type": "open_collective" 1040 | } 1041 | ], 1042 | "time": "2022-11-30T15:59:55+00:00" 1043 | }, 1044 | { 1045 | "name": "react/dns", 1046 | "version": "v1.13.0", 1047 | "source": { 1048 | "type": "git", 1049 | "url": "https://github.com/reactphp/dns.git", 1050 | "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" 1051 | }, 1052 | "dist": { 1053 | "type": "zip", 1054 | "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", 1055 | "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", 1056 | "shasum": "" 1057 | }, 1058 | "require": { 1059 | "php": ">=5.3.0", 1060 | "react/cache": "^1.0 || ^0.6 || ^0.5", 1061 | "react/event-loop": "^1.2", 1062 | "react/promise": "^3.2 || ^2.7 || ^1.2.1" 1063 | }, 1064 | "require-dev": { 1065 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", 1066 | "react/async": "^4.3 || ^3 || ^2", 1067 | "react/promise-timer": "^1.11" 1068 | }, 1069 | "type": "library", 1070 | "autoload": { 1071 | "psr-4": { 1072 | "React\\Dns\\": "src/" 1073 | } 1074 | }, 1075 | "notification-url": "https://packagist.org/downloads/", 1076 | "license": [ 1077 | "MIT" 1078 | ], 1079 | "authors": [ 1080 | { 1081 | "name": "Christian Lück", 1082 | "email": "christian@clue.engineering", 1083 | "homepage": "https://clue.engineering/" 1084 | }, 1085 | { 1086 | "name": "Cees-Jan Kiewiet", 1087 | "email": "reactphp@ceesjankiewiet.nl", 1088 | "homepage": "https://wyrihaximus.net/" 1089 | }, 1090 | { 1091 | "name": "Jan Sorgalla", 1092 | "email": "jsorgalla@gmail.com", 1093 | "homepage": "https://sorgalla.com/" 1094 | }, 1095 | { 1096 | "name": "Chris Boden", 1097 | "email": "cboden@gmail.com", 1098 | "homepage": "https://cboden.dev/" 1099 | } 1100 | ], 1101 | "description": "Async DNS resolver for ReactPHP", 1102 | "keywords": [ 1103 | "async", 1104 | "dns", 1105 | "dns-resolver", 1106 | "reactphp" 1107 | ], 1108 | "support": { 1109 | "issues": "https://github.com/reactphp/dns/issues", 1110 | "source": "https://github.com/reactphp/dns/tree/v1.13.0" 1111 | }, 1112 | "funding": [ 1113 | { 1114 | "url": "https://opencollective.com/reactphp", 1115 | "type": "open_collective" 1116 | } 1117 | ], 1118 | "time": "2024-06-13T14:18:03+00:00" 1119 | }, 1120 | { 1121 | "name": "react/event-loop", 1122 | "version": "v1.5.0", 1123 | "source": { 1124 | "type": "git", 1125 | "url": "https://github.com/reactphp/event-loop.git", 1126 | "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" 1127 | }, 1128 | "dist": { 1129 | "type": "zip", 1130 | "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", 1131 | "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", 1132 | "shasum": "" 1133 | }, 1134 | "require": { 1135 | "php": ">=5.3.0" 1136 | }, 1137 | "require-dev": { 1138 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" 1139 | }, 1140 | "suggest": { 1141 | "ext-pcntl": "For signal handling support when using the StreamSelectLoop" 1142 | }, 1143 | "type": "library", 1144 | "autoload": { 1145 | "psr-4": { 1146 | "React\\EventLoop\\": "src/" 1147 | } 1148 | }, 1149 | "notification-url": "https://packagist.org/downloads/", 1150 | "license": [ 1151 | "MIT" 1152 | ], 1153 | "authors": [ 1154 | { 1155 | "name": "Christian Lück", 1156 | "email": "christian@clue.engineering", 1157 | "homepage": "https://clue.engineering/" 1158 | }, 1159 | { 1160 | "name": "Cees-Jan Kiewiet", 1161 | "email": "reactphp@ceesjankiewiet.nl", 1162 | "homepage": "https://wyrihaximus.net/" 1163 | }, 1164 | { 1165 | "name": "Jan Sorgalla", 1166 | "email": "jsorgalla@gmail.com", 1167 | "homepage": "https://sorgalla.com/" 1168 | }, 1169 | { 1170 | "name": "Chris Boden", 1171 | "email": "cboden@gmail.com", 1172 | "homepage": "https://cboden.dev/" 1173 | } 1174 | ], 1175 | "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", 1176 | "keywords": [ 1177 | "asynchronous", 1178 | "event-loop" 1179 | ], 1180 | "support": { 1181 | "issues": "https://github.com/reactphp/event-loop/issues", 1182 | "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" 1183 | }, 1184 | "funding": [ 1185 | { 1186 | "url": "https://opencollective.com/reactphp", 1187 | "type": "open_collective" 1188 | } 1189 | ], 1190 | "time": "2023-11-13T13:48:05+00:00" 1191 | }, 1192 | { 1193 | "name": "react/http", 1194 | "version": "v1.11.0", 1195 | "source": { 1196 | "type": "git", 1197 | "url": "https://github.com/reactphp/http.git", 1198 | "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9" 1199 | }, 1200 | "dist": { 1201 | "type": "zip", 1202 | "url": "https://api.github.com/repos/reactphp/http/zipball/8db02de41dcca82037367f67a2d4be365b1c4db9", 1203 | "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9", 1204 | "shasum": "" 1205 | }, 1206 | "require": { 1207 | "evenement/evenement": "^3.0 || ^2.0 || ^1.0", 1208 | "fig/http-message-util": "^1.1", 1209 | "php": ">=5.3.0", 1210 | "psr/http-message": "^1.0", 1211 | "react/event-loop": "^1.2", 1212 | "react/promise": "^3.2 || ^2.3 || ^1.2.1", 1213 | "react/socket": "^1.16", 1214 | "react/stream": "^1.4" 1215 | }, 1216 | "require-dev": { 1217 | "clue/http-proxy-react": "^1.8", 1218 | "clue/reactphp-ssh-proxy": "^1.4", 1219 | "clue/socks-react": "^1.4", 1220 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", 1221 | "react/async": "^4.2 || ^3 || ^2", 1222 | "react/promise-stream": "^1.4", 1223 | "react/promise-timer": "^1.11" 1224 | }, 1225 | "type": "library", 1226 | "autoload": { 1227 | "psr-4": { 1228 | "React\\Http\\": "src/" 1229 | } 1230 | }, 1231 | "notification-url": "https://packagist.org/downloads/", 1232 | "license": [ 1233 | "MIT" 1234 | ], 1235 | "authors": [ 1236 | { 1237 | "name": "Christian Lück", 1238 | "email": "christian@clue.engineering", 1239 | "homepage": "https://clue.engineering/" 1240 | }, 1241 | { 1242 | "name": "Cees-Jan Kiewiet", 1243 | "email": "reactphp@ceesjankiewiet.nl", 1244 | "homepage": "https://wyrihaximus.net/" 1245 | }, 1246 | { 1247 | "name": "Jan Sorgalla", 1248 | "email": "jsorgalla@gmail.com", 1249 | "homepage": "https://sorgalla.com/" 1250 | }, 1251 | { 1252 | "name": "Chris Boden", 1253 | "email": "cboden@gmail.com", 1254 | "homepage": "https://cboden.dev/" 1255 | } 1256 | ], 1257 | "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", 1258 | "keywords": [ 1259 | "async", 1260 | "client", 1261 | "event-driven", 1262 | "http", 1263 | "http client", 1264 | "http server", 1265 | "https", 1266 | "psr-7", 1267 | "reactphp", 1268 | "server", 1269 | "streaming" 1270 | ], 1271 | "support": { 1272 | "issues": "https://github.com/reactphp/http/issues", 1273 | "source": "https://github.com/reactphp/http/tree/v1.11.0" 1274 | }, 1275 | "funding": [ 1276 | { 1277 | "url": "https://opencollective.com/reactphp", 1278 | "type": "open_collective" 1279 | } 1280 | ], 1281 | "time": "2024-11-20T15:24:08+00:00" 1282 | }, 1283 | { 1284 | "name": "react/promise", 1285 | "version": "v3.2.0", 1286 | "source": { 1287 | "type": "git", 1288 | "url": "https://github.com/reactphp/promise.git", 1289 | "reference": "8a164643313c71354582dc850b42b33fa12a4b63" 1290 | }, 1291 | "dist": { 1292 | "type": "zip", 1293 | "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", 1294 | "reference": "8a164643313c71354582dc850b42b33fa12a4b63", 1295 | "shasum": "" 1296 | }, 1297 | "require": { 1298 | "php": ">=7.1.0" 1299 | }, 1300 | "require-dev": { 1301 | "phpstan/phpstan": "1.10.39 || 1.4.10", 1302 | "phpunit/phpunit": "^9.6 || ^7.5" 1303 | }, 1304 | "type": "library", 1305 | "autoload": { 1306 | "files": [ 1307 | "src/functions_include.php" 1308 | ], 1309 | "psr-4": { 1310 | "React\\Promise\\": "src/" 1311 | } 1312 | }, 1313 | "notification-url": "https://packagist.org/downloads/", 1314 | "license": [ 1315 | "MIT" 1316 | ], 1317 | "authors": [ 1318 | { 1319 | "name": "Jan Sorgalla", 1320 | "email": "jsorgalla@gmail.com", 1321 | "homepage": "https://sorgalla.com/" 1322 | }, 1323 | { 1324 | "name": "Christian Lück", 1325 | "email": "christian@clue.engineering", 1326 | "homepage": "https://clue.engineering/" 1327 | }, 1328 | { 1329 | "name": "Cees-Jan Kiewiet", 1330 | "email": "reactphp@ceesjankiewiet.nl", 1331 | "homepage": "https://wyrihaximus.net/" 1332 | }, 1333 | { 1334 | "name": "Chris Boden", 1335 | "email": "cboden@gmail.com", 1336 | "homepage": "https://cboden.dev/" 1337 | } 1338 | ], 1339 | "description": "A lightweight implementation of CommonJS Promises/A for PHP", 1340 | "keywords": [ 1341 | "promise", 1342 | "promises" 1343 | ], 1344 | "support": { 1345 | "issues": "https://github.com/reactphp/promise/issues", 1346 | "source": "https://github.com/reactphp/promise/tree/v3.2.0" 1347 | }, 1348 | "funding": [ 1349 | { 1350 | "url": "https://opencollective.com/reactphp", 1351 | "type": "open_collective" 1352 | } 1353 | ], 1354 | "time": "2024-05-24T10:39:05+00:00" 1355 | }, 1356 | { 1357 | "name": "react/promise-stream", 1358 | "version": "v1.7.0", 1359 | "source": { 1360 | "type": "git", 1361 | "url": "https://github.com/reactphp/promise-stream.git", 1362 | "reference": "5c7ec3450f558deb779742e33967d837e2db7871" 1363 | }, 1364 | "dist": { 1365 | "type": "zip", 1366 | "url": "https://api.github.com/repos/reactphp/promise-stream/zipball/5c7ec3450f558deb779742e33967d837e2db7871", 1367 | "reference": "5c7ec3450f558deb779742e33967d837e2db7871", 1368 | "shasum": "" 1369 | }, 1370 | "require": { 1371 | "php": ">=5.3", 1372 | "react/promise": "^3 || ^2.1 || ^1.2", 1373 | "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6" 1374 | }, 1375 | "require-dev": { 1376 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" 1377 | }, 1378 | "type": "library", 1379 | "autoload": { 1380 | "files": [ 1381 | "src/functions_include.php" 1382 | ], 1383 | "psr-4": { 1384 | "React\\Promise\\Stream\\": "src/" 1385 | } 1386 | }, 1387 | "notification-url": "https://packagist.org/downloads/", 1388 | "license": [ 1389 | "MIT" 1390 | ], 1391 | "authors": [ 1392 | { 1393 | "name": "Christian Lück", 1394 | "email": "christian@clue.engineering", 1395 | "homepage": "https://clue.engineering/" 1396 | }, 1397 | { 1398 | "name": "Cees-Jan Kiewiet", 1399 | "email": "reactphp@ceesjankiewiet.nl", 1400 | "homepage": "https://wyrihaximus.net/" 1401 | }, 1402 | { 1403 | "name": "Jan Sorgalla", 1404 | "email": "jsorgalla@gmail.com", 1405 | "homepage": "https://sorgalla.com/" 1406 | }, 1407 | { 1408 | "name": "Chris Boden", 1409 | "email": "cboden@gmail.com", 1410 | "homepage": "https://cboden.dev/" 1411 | } 1412 | ], 1413 | "description": "The missing link between Promise-land and Stream-land for ReactPHP", 1414 | "homepage": "https://github.com/reactphp/promise-stream", 1415 | "keywords": [ 1416 | "Buffer", 1417 | "async", 1418 | "promise", 1419 | "reactphp", 1420 | "stream", 1421 | "unwrap" 1422 | ], 1423 | "support": { 1424 | "issues": "https://github.com/reactphp/promise-stream/issues", 1425 | "source": "https://github.com/reactphp/promise-stream/tree/v1.7.0" 1426 | }, 1427 | "funding": [ 1428 | { 1429 | "url": "https://opencollective.com/reactphp", 1430 | "type": "open_collective" 1431 | } 1432 | ], 1433 | "time": "2023-12-13T11:32:02+00:00" 1434 | }, 1435 | { 1436 | "name": "react/promise-timer", 1437 | "version": "v1.11.0", 1438 | "source": { 1439 | "type": "git", 1440 | "url": "https://github.com/reactphp/promise-timer.git", 1441 | "reference": "4f70306ed66b8b44768941ca7f142092600fafc1" 1442 | }, 1443 | "dist": { 1444 | "type": "zip", 1445 | "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/4f70306ed66b8b44768941ca7f142092600fafc1", 1446 | "reference": "4f70306ed66b8b44768941ca7f142092600fafc1", 1447 | "shasum": "" 1448 | }, 1449 | "require": { 1450 | "php": ">=5.3", 1451 | "react/event-loop": "^1.2", 1452 | "react/promise": "^3.2 || ^2.7.0 || ^1.2.1" 1453 | }, 1454 | "require-dev": { 1455 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" 1456 | }, 1457 | "type": "library", 1458 | "autoload": { 1459 | "files": [ 1460 | "src/functions_include.php" 1461 | ], 1462 | "psr-4": { 1463 | "React\\Promise\\Timer\\": "src/" 1464 | } 1465 | }, 1466 | "notification-url": "https://packagist.org/downloads/", 1467 | "license": [ 1468 | "MIT" 1469 | ], 1470 | "authors": [ 1471 | { 1472 | "name": "Christian Lück", 1473 | "email": "christian@clue.engineering", 1474 | "homepage": "https://clue.engineering/" 1475 | }, 1476 | { 1477 | "name": "Cees-Jan Kiewiet", 1478 | "email": "reactphp@ceesjankiewiet.nl", 1479 | "homepage": "https://wyrihaximus.net/" 1480 | }, 1481 | { 1482 | "name": "Jan Sorgalla", 1483 | "email": "jsorgalla@gmail.com", 1484 | "homepage": "https://sorgalla.com/" 1485 | }, 1486 | { 1487 | "name": "Chris Boden", 1488 | "email": "cboden@gmail.com", 1489 | "homepage": "https://cboden.dev/" 1490 | } 1491 | ], 1492 | "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", 1493 | "homepage": "https://github.com/reactphp/promise-timer", 1494 | "keywords": [ 1495 | "async", 1496 | "event-loop", 1497 | "promise", 1498 | "reactphp", 1499 | "timeout", 1500 | "timer" 1501 | ], 1502 | "support": { 1503 | "issues": "https://github.com/reactphp/promise-timer/issues", 1504 | "source": "https://github.com/reactphp/promise-timer/tree/v1.11.0" 1505 | }, 1506 | "funding": [ 1507 | { 1508 | "url": "https://opencollective.com/reactphp", 1509 | "type": "open_collective" 1510 | } 1511 | ], 1512 | "time": "2024-06-04T14:27:45+00:00" 1513 | }, 1514 | { 1515 | "name": "react/react", 1516 | "version": "v1.4.0", 1517 | "source": { 1518 | "type": "git", 1519 | "url": "https://github.com/reactphp/reactphp.git", 1520 | "reference": "726e5de40567c9effaa8e5665b1a2621af8d7ee9" 1521 | }, 1522 | "dist": { 1523 | "type": "zip", 1524 | "url": "https://api.github.com/repos/reactphp/reactphp/zipball/726e5de40567c9effaa8e5665b1a2621af8d7ee9", 1525 | "reference": "726e5de40567c9effaa8e5665b1a2621af8d7ee9", 1526 | "shasum": "" 1527 | }, 1528 | "require": { 1529 | "php": ">=5.3.8", 1530 | "react/async": "^4 || ^3 || ^2", 1531 | "react/cache": "^1.1", 1532 | "react/dns": "^1.11", 1533 | "react/event-loop": "^1.4", 1534 | "react/http": "^1.8", 1535 | "react/promise": "^3 || ^2.10 || ^1.2", 1536 | "react/promise-stream": "^1.6", 1537 | "react/promise-timer": "^1.9", 1538 | "react/socket": "^1.13", 1539 | "react/stream": "^1.3" 1540 | }, 1541 | "require-dev": { 1542 | "clue/stream-filter": "^1.3", 1543 | "phpunit/phpunit": "^9.6 || ^7.5 || ^5.7 || ^4.8.36", 1544 | "react/async": "^4.2@dev || ^3.2@dev || ^4 || ^3 || ^2", 1545 | "react/dns": "^1.12@dev", 1546 | "react/http": "^1.10@dev", 1547 | "react/promise": "^3@dev || ^2.10 || ^1.2", 1548 | "react/promise-stream": "^1.7@dev", 1549 | "react/promise-timer": "^1.10@dev", 1550 | "react/socket": "^1.14@dev" 1551 | }, 1552 | "type": "library", 1553 | "notification-url": "https://packagist.org/downloads/", 1554 | "license": [ 1555 | "MIT" 1556 | ], 1557 | "description": "ReactPHP: Event-driven, non-blocking I/O with PHP.", 1558 | "homepage": "https://reactphp.org/", 1559 | "keywords": [ 1560 | "asynchronous", 1561 | "reactor", 1562 | "reactphp" 1563 | ], 1564 | "support": { 1565 | "chat": "https://gitter.im/reactphp/reactphp", 1566 | "issues": "https://github.com/reactphp/reactphp/issues", 1567 | "source": "https://github.com/reactphp/reactphp/tree/v1.4.0" 1568 | }, 1569 | "funding": [ 1570 | { 1571 | "url": "https://opencollective.com/reactphp", 1572 | "type": "open_collective" 1573 | } 1574 | ], 1575 | "time": "2023-07-11T16:08:54+00:00" 1576 | }, 1577 | { 1578 | "name": "react/socket", 1579 | "version": "v1.16.0", 1580 | "source": { 1581 | "type": "git", 1582 | "url": "https://github.com/reactphp/socket.git", 1583 | "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" 1584 | }, 1585 | "dist": { 1586 | "type": "zip", 1587 | "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", 1588 | "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", 1589 | "shasum": "" 1590 | }, 1591 | "require": { 1592 | "evenement/evenement": "^3.0 || ^2.0 || ^1.0", 1593 | "php": ">=5.3.0", 1594 | "react/dns": "^1.13", 1595 | "react/event-loop": "^1.2", 1596 | "react/promise": "^3.2 || ^2.6 || ^1.2.1", 1597 | "react/stream": "^1.4" 1598 | }, 1599 | "require-dev": { 1600 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", 1601 | "react/async": "^4.3 || ^3.3 || ^2", 1602 | "react/promise-stream": "^1.4", 1603 | "react/promise-timer": "^1.11" 1604 | }, 1605 | "type": "library", 1606 | "autoload": { 1607 | "psr-4": { 1608 | "React\\Socket\\": "src/" 1609 | } 1610 | }, 1611 | "notification-url": "https://packagist.org/downloads/", 1612 | "license": [ 1613 | "MIT" 1614 | ], 1615 | "authors": [ 1616 | { 1617 | "name": "Christian Lück", 1618 | "email": "christian@clue.engineering", 1619 | "homepage": "https://clue.engineering/" 1620 | }, 1621 | { 1622 | "name": "Cees-Jan Kiewiet", 1623 | "email": "reactphp@ceesjankiewiet.nl", 1624 | "homepage": "https://wyrihaximus.net/" 1625 | }, 1626 | { 1627 | "name": "Jan Sorgalla", 1628 | "email": "jsorgalla@gmail.com", 1629 | "homepage": "https://sorgalla.com/" 1630 | }, 1631 | { 1632 | "name": "Chris Boden", 1633 | "email": "cboden@gmail.com", 1634 | "homepage": "https://cboden.dev/" 1635 | } 1636 | ], 1637 | "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", 1638 | "keywords": [ 1639 | "Connection", 1640 | "Socket", 1641 | "async", 1642 | "reactphp", 1643 | "stream" 1644 | ], 1645 | "support": { 1646 | "issues": "https://github.com/reactphp/socket/issues", 1647 | "source": "https://github.com/reactphp/socket/tree/v1.16.0" 1648 | }, 1649 | "funding": [ 1650 | { 1651 | "url": "https://opencollective.com/reactphp", 1652 | "type": "open_collective" 1653 | } 1654 | ], 1655 | "time": "2024-07-26T10:38:09+00:00" 1656 | }, 1657 | { 1658 | "name": "react/stream", 1659 | "version": "v1.4.0", 1660 | "source": { 1661 | "type": "git", 1662 | "url": "https://github.com/reactphp/stream.git", 1663 | "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" 1664 | }, 1665 | "dist": { 1666 | "type": "zip", 1667 | "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", 1668 | "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", 1669 | "shasum": "" 1670 | }, 1671 | "require": { 1672 | "evenement/evenement": "^3.0 || ^2.0 || ^1.0", 1673 | "php": ">=5.3.8", 1674 | "react/event-loop": "^1.2" 1675 | }, 1676 | "require-dev": { 1677 | "clue/stream-filter": "~1.2", 1678 | "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" 1679 | }, 1680 | "type": "library", 1681 | "autoload": { 1682 | "psr-4": { 1683 | "React\\Stream\\": "src/" 1684 | } 1685 | }, 1686 | "notification-url": "https://packagist.org/downloads/", 1687 | "license": [ 1688 | "MIT" 1689 | ], 1690 | "authors": [ 1691 | { 1692 | "name": "Christian Lück", 1693 | "email": "christian@clue.engineering", 1694 | "homepage": "https://clue.engineering/" 1695 | }, 1696 | { 1697 | "name": "Cees-Jan Kiewiet", 1698 | "email": "reactphp@ceesjankiewiet.nl", 1699 | "homepage": "https://wyrihaximus.net/" 1700 | }, 1701 | { 1702 | "name": "Jan Sorgalla", 1703 | "email": "jsorgalla@gmail.com", 1704 | "homepage": "https://sorgalla.com/" 1705 | }, 1706 | { 1707 | "name": "Chris Boden", 1708 | "email": "cboden@gmail.com", 1709 | "homepage": "https://cboden.dev/" 1710 | } 1711 | ], 1712 | "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", 1713 | "keywords": [ 1714 | "event-driven", 1715 | "io", 1716 | "non-blocking", 1717 | "pipe", 1718 | "reactphp", 1719 | "readable", 1720 | "stream", 1721 | "writable" 1722 | ], 1723 | "support": { 1724 | "issues": "https://github.com/reactphp/stream/issues", 1725 | "source": "https://github.com/reactphp/stream/tree/v1.4.0" 1726 | }, 1727 | "funding": [ 1728 | { 1729 | "url": "https://opencollective.com/reactphp", 1730 | "type": "open_collective" 1731 | } 1732 | ], 1733 | "time": "2024-06-11T12:45:25+00:00" 1734 | }, 1735 | { 1736 | "name": "react/zmq", 1737 | "version": "v0.4.0", 1738 | "source": { 1739 | "type": "git", 1740 | "url": "https://github.com/friends-of-reactphp/zmq.git", 1741 | "reference": "13dec0bd2397adcc5d6aa54c8d7f0982fba66f39" 1742 | }, 1743 | "dist": { 1744 | "type": "zip", 1745 | "url": "https://api.github.com/repos/friends-of-reactphp/zmq/zipball/13dec0bd2397adcc5d6aa54c8d7f0982fba66f39", 1746 | "reference": "13dec0bd2397adcc5d6aa54c8d7f0982fba66f39", 1747 | "shasum": "" 1748 | }, 1749 | "require": { 1750 | "evenement/evenement": "^3.0 || ^2.0", 1751 | "ext-zmq": "*", 1752 | "php": ">=5.4.0", 1753 | "react/event-loop": "^1.0 || ^0.5 || ^0.4" 1754 | }, 1755 | "require-dev": { 1756 | "ext-pcntl": "*", 1757 | "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4" 1758 | }, 1759 | "type": "library", 1760 | "autoload": { 1761 | "psr-4": { 1762 | "React\\ZMQ\\": "src" 1763 | } 1764 | }, 1765 | "notification-url": "https://packagist.org/downloads/", 1766 | "license": [ 1767 | "MIT" 1768 | ], 1769 | "description": "ZeroMQ bindings for React.", 1770 | "keywords": [ 1771 | "zeromq", 1772 | "zmq" 1773 | ], 1774 | "support": { 1775 | "issues": "https://github.com/friends-of-reactphp/zmq/issues", 1776 | "source": "https://github.com/friends-of-reactphp/zmq/tree/master" 1777 | }, 1778 | "time": "2018-05-18T15:27:55+00:00" 1779 | }, 1780 | { 1781 | "name": "symfony/deprecation-contracts", 1782 | "version": "v3.5.1", 1783 | "source": { 1784 | "type": "git", 1785 | "url": "https://github.com/symfony/deprecation-contracts.git", 1786 | "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" 1787 | }, 1788 | "dist": { 1789 | "type": "zip", 1790 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", 1791 | "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", 1792 | "shasum": "" 1793 | }, 1794 | "require": { 1795 | "php": ">=8.1" 1796 | }, 1797 | "type": "library", 1798 | "extra": { 1799 | "branch-alias": { 1800 | "dev-main": "3.5-dev" 1801 | }, 1802 | "thanks": { 1803 | "name": "symfony/contracts", 1804 | "url": "https://github.com/symfony/contracts" 1805 | } 1806 | }, 1807 | "autoload": { 1808 | "files": [ 1809 | "function.php" 1810 | ] 1811 | }, 1812 | "notification-url": "https://packagist.org/downloads/", 1813 | "license": [ 1814 | "MIT" 1815 | ], 1816 | "authors": [ 1817 | { 1818 | "name": "Nicolas Grekas", 1819 | "email": "p@tchwork.com" 1820 | }, 1821 | { 1822 | "name": "Symfony Community", 1823 | "homepage": "https://symfony.com/contributors" 1824 | } 1825 | ], 1826 | "description": "A generic function and convention to trigger deprecation notices", 1827 | "homepage": "https://symfony.com", 1828 | "support": { 1829 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" 1830 | }, 1831 | "funding": [ 1832 | { 1833 | "url": "https://symfony.com/sponsor", 1834 | "type": "custom" 1835 | }, 1836 | { 1837 | "url": "https://github.com/fabpot", 1838 | "type": "github" 1839 | }, 1840 | { 1841 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1842 | "type": "tidelift" 1843 | } 1844 | ], 1845 | "time": "2024-09-25T14:20:29+00:00" 1846 | }, 1847 | { 1848 | "name": "symfony/http-foundation", 1849 | "version": "v6.4.16", 1850 | "source": { 1851 | "type": "git", 1852 | "url": "https://github.com/symfony/http-foundation.git", 1853 | "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" 1854 | }, 1855 | "dist": { 1856 | "type": "zip", 1857 | "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", 1858 | "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", 1859 | "shasum": "" 1860 | }, 1861 | "require": { 1862 | "php": ">=8.1", 1863 | "symfony/deprecation-contracts": "^2.5|^3", 1864 | "symfony/polyfill-mbstring": "~1.1", 1865 | "symfony/polyfill-php83": "^1.27" 1866 | }, 1867 | "conflict": { 1868 | "symfony/cache": "<6.4.12|>=7.0,<7.1.5" 1869 | }, 1870 | "require-dev": { 1871 | "doctrine/dbal": "^2.13.1|^3|^4", 1872 | "predis/predis": "^1.1|^2.0", 1873 | "symfony/cache": "^6.4.12|^7.1.5", 1874 | "symfony/dependency-injection": "^5.4|^6.0|^7.0", 1875 | "symfony/expression-language": "^5.4|^6.0|^7.0", 1876 | "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", 1877 | "symfony/mime": "^5.4|^6.0|^7.0", 1878 | "symfony/rate-limiter": "^5.4|^6.0|^7.0" 1879 | }, 1880 | "type": "library", 1881 | "autoload": { 1882 | "psr-4": { 1883 | "Symfony\\Component\\HttpFoundation\\": "" 1884 | }, 1885 | "exclude-from-classmap": [ 1886 | "/Tests/" 1887 | ] 1888 | }, 1889 | "notification-url": "https://packagist.org/downloads/", 1890 | "license": [ 1891 | "MIT" 1892 | ], 1893 | "authors": [ 1894 | { 1895 | "name": "Fabien Potencier", 1896 | "email": "fabien@symfony.com" 1897 | }, 1898 | { 1899 | "name": "Symfony Community", 1900 | "homepage": "https://symfony.com/contributors" 1901 | } 1902 | ], 1903 | "description": "Defines an object-oriented layer for the HTTP specification", 1904 | "homepage": "https://symfony.com", 1905 | "support": { 1906 | "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" 1907 | }, 1908 | "funding": [ 1909 | { 1910 | "url": "https://symfony.com/sponsor", 1911 | "type": "custom" 1912 | }, 1913 | { 1914 | "url": "https://github.com/fabpot", 1915 | "type": "github" 1916 | }, 1917 | { 1918 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1919 | "type": "tidelift" 1920 | } 1921 | ], 1922 | "time": "2024-11-13T18:58:10+00:00" 1923 | }, 1924 | { 1925 | "name": "symfony/polyfill-mbstring", 1926 | "version": "v1.31.0", 1927 | "source": { 1928 | "type": "git", 1929 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1930 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" 1931 | }, 1932 | "dist": { 1933 | "type": "zip", 1934 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", 1935 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", 1936 | "shasum": "" 1937 | }, 1938 | "require": { 1939 | "php": ">=7.2" 1940 | }, 1941 | "provide": { 1942 | "ext-mbstring": "*" 1943 | }, 1944 | "suggest": { 1945 | "ext-mbstring": "For best performance" 1946 | }, 1947 | "type": "library", 1948 | "extra": { 1949 | "thanks": { 1950 | "name": "symfony/polyfill", 1951 | "url": "https://github.com/symfony/polyfill" 1952 | } 1953 | }, 1954 | "autoload": { 1955 | "files": [ 1956 | "bootstrap.php" 1957 | ], 1958 | "psr-4": { 1959 | "Symfony\\Polyfill\\Mbstring\\": "" 1960 | } 1961 | }, 1962 | "notification-url": "https://packagist.org/downloads/", 1963 | "license": [ 1964 | "MIT" 1965 | ], 1966 | "authors": [ 1967 | { 1968 | "name": "Nicolas Grekas", 1969 | "email": "p@tchwork.com" 1970 | }, 1971 | { 1972 | "name": "Symfony Community", 1973 | "homepage": "https://symfony.com/contributors" 1974 | } 1975 | ], 1976 | "description": "Symfony polyfill for the Mbstring extension", 1977 | "homepage": "https://symfony.com", 1978 | "keywords": [ 1979 | "compatibility", 1980 | "mbstring", 1981 | "polyfill", 1982 | "portable", 1983 | "shim" 1984 | ], 1985 | "support": { 1986 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" 1987 | }, 1988 | "funding": [ 1989 | { 1990 | "url": "https://symfony.com/sponsor", 1991 | "type": "custom" 1992 | }, 1993 | { 1994 | "url": "https://github.com/fabpot", 1995 | "type": "github" 1996 | }, 1997 | { 1998 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1999 | "type": "tidelift" 2000 | } 2001 | ], 2002 | "time": "2024-09-09T11:45:10+00:00" 2003 | }, 2004 | { 2005 | "name": "symfony/polyfill-php83", 2006 | "version": "v1.31.0", 2007 | "source": { 2008 | "type": "git", 2009 | "url": "https://github.com/symfony/polyfill-php83.git", 2010 | "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" 2011 | }, 2012 | "dist": { 2013 | "type": "zip", 2014 | "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", 2015 | "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", 2016 | "shasum": "" 2017 | }, 2018 | "require": { 2019 | "php": ">=7.2" 2020 | }, 2021 | "type": "library", 2022 | "extra": { 2023 | "thanks": { 2024 | "name": "symfony/polyfill", 2025 | "url": "https://github.com/symfony/polyfill" 2026 | } 2027 | }, 2028 | "autoload": { 2029 | "files": [ 2030 | "bootstrap.php" 2031 | ], 2032 | "psr-4": { 2033 | "Symfony\\Polyfill\\Php83\\": "" 2034 | }, 2035 | "classmap": [ 2036 | "Resources/stubs" 2037 | ] 2038 | }, 2039 | "notification-url": "https://packagist.org/downloads/", 2040 | "license": [ 2041 | "MIT" 2042 | ], 2043 | "authors": [ 2044 | { 2045 | "name": "Nicolas Grekas", 2046 | "email": "p@tchwork.com" 2047 | }, 2048 | { 2049 | "name": "Symfony Community", 2050 | "homepage": "https://symfony.com/contributors" 2051 | } 2052 | ], 2053 | "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", 2054 | "homepage": "https://symfony.com", 2055 | "keywords": [ 2056 | "compatibility", 2057 | "polyfill", 2058 | "portable", 2059 | "shim" 2060 | ], 2061 | "support": { 2062 | "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" 2063 | }, 2064 | "funding": [ 2065 | { 2066 | "url": "https://symfony.com/sponsor", 2067 | "type": "custom" 2068 | }, 2069 | { 2070 | "url": "https://github.com/fabpot", 2071 | "type": "github" 2072 | }, 2073 | { 2074 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 2075 | "type": "tidelift" 2076 | } 2077 | ], 2078 | "time": "2024-09-09T11:45:10+00:00" 2079 | }, 2080 | { 2081 | "name": "symfony/routing", 2082 | "version": "v6.4.16", 2083 | "source": { 2084 | "type": "git", 2085 | "url": "https://github.com/symfony/routing.git", 2086 | "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" 2087 | }, 2088 | "dist": { 2089 | "type": "zip", 2090 | "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", 2091 | "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", 2092 | "shasum": "" 2093 | }, 2094 | "require": { 2095 | "php": ">=8.1", 2096 | "symfony/deprecation-contracts": "^2.5|^3" 2097 | }, 2098 | "conflict": { 2099 | "doctrine/annotations": "<1.12", 2100 | "symfony/config": "<6.2", 2101 | "symfony/dependency-injection": "<5.4", 2102 | "symfony/yaml": "<5.4" 2103 | }, 2104 | "require-dev": { 2105 | "doctrine/annotations": "^1.12|^2", 2106 | "psr/log": "^1|^2|^3", 2107 | "symfony/config": "^6.2|^7.0", 2108 | "symfony/dependency-injection": "^5.4|^6.0|^7.0", 2109 | "symfony/expression-language": "^5.4|^6.0|^7.0", 2110 | "symfony/http-foundation": "^5.4|^6.0|^7.0", 2111 | "symfony/yaml": "^5.4|^6.0|^7.0" 2112 | }, 2113 | "type": "library", 2114 | "autoload": { 2115 | "psr-4": { 2116 | "Symfony\\Component\\Routing\\": "" 2117 | }, 2118 | "exclude-from-classmap": [ 2119 | "/Tests/" 2120 | ] 2121 | }, 2122 | "notification-url": "https://packagist.org/downloads/", 2123 | "license": [ 2124 | "MIT" 2125 | ], 2126 | "authors": [ 2127 | { 2128 | "name": "Fabien Potencier", 2129 | "email": "fabien@symfony.com" 2130 | }, 2131 | { 2132 | "name": "Symfony Community", 2133 | "homepage": "https://symfony.com/contributors" 2134 | } 2135 | ], 2136 | "description": "Maps an HTTP request to a set of configuration variables", 2137 | "homepage": "https://symfony.com", 2138 | "keywords": [ 2139 | "router", 2140 | "routing", 2141 | "uri", 2142 | "url" 2143 | ], 2144 | "support": { 2145 | "source": "https://github.com/symfony/routing/tree/v6.4.16" 2146 | }, 2147 | "funding": [ 2148 | { 2149 | "url": "https://symfony.com/sponsor", 2150 | "type": "custom" 2151 | }, 2152 | { 2153 | "url": "https://github.com/fabpot", 2154 | "type": "github" 2155 | }, 2156 | { 2157 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 2158 | "type": "tidelift" 2159 | } 2160 | ], 2161 | "time": "2024-11-13T15:31:34+00:00" 2162 | } 2163 | ], 2164 | "packages-dev": [], 2165 | "aliases": [], 2166 | "minimum-stability": "stable", 2167 | "stability-flags": [], 2168 | "prefer-stable": false, 2169 | "prefer-lowest": false, 2170 | "platform": { 2171 | "php": ">=8.2" 2172 | }, 2173 | "platform-dev": [], 2174 | "platform-overrides": { 2175 | "php": "8.2", 2176 | "ext-zmq": "1" 2177 | }, 2178 | "plugin-api-version": "2.3.0" 2179 | } 2180 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | xmr: 5 | build: . 6 | ports: 7 | - "8080:8080" 8 | - "8081:8081" 9 | environment: 10 | XMR_DEBUG: "true" 11 | volumes: 12 | - ./:/opt/xmr -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright (C) 2025 Xibo Signage Ltd 5 | # 6 | # Xibo - Digital Signage - https://xibosignage.com 7 | # 8 | # This file is part of Xibo. 9 | # 10 | # Xibo is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU Affero General Public License as published by 12 | # the Free Software Foundation, either version 3 of the License, or 13 | # any later version. 14 | # 15 | # Xibo is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU Affero General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU Affero General Public License 21 | # along with Xibo. If not, see . 22 | # 23 | 24 | # Write config.json 25 | echo '{' > /opt/xmr/config.json 26 | echo ' "sockets": {' >> /opt/xmr/config.json 27 | echo ' "ws": "'$XMR_SOCKETS_WS'",' >> /opt/xmr/config.json 28 | echo ' "api": "'$XMR_SOCKETS_API'",' >> /opt/xmr/config.json 29 | echo ' "zmq": ["tcp://*:'$XMR_SOCKETS_ZM_PORT'"]' >> /opt/xmr/config.json 30 | echo ' },' >> /opt/xmr/config.json 31 | echo ' "queuePoll": '$XMR_QUEUE_POLL',' >> /opt/xmr/config.json 32 | echo ' "queueSize": '$XMR_QUEUE_SIZE',' >> /opt/xmr/config.json 33 | echo ' "debug": '$XMR_DEBUG',' >> /opt/xmr/config.json 34 | echo ' "ipv6PubSupport": '$XMR_IPV6PUBSUPPORT',' >> /opt/xmr/config.json 35 | echo ' "relayOldMessages": "'$XMR_RELAY_OLD_MESSAGES'",' >> /opt/xmr/config.json 36 | echo ' "relayMessages": "'$XMR_RELAY_MESSAGES'"' >> /opt/xmr/config.json 37 | echo '}' >> /opt/xmr/config.json 38 | 39 | /usr/local/bin/php /opt/xmr/index.php -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | . 22 | */ 23 | 24 | use Monolog\Handler\StreamHandler; 25 | use Monolog\Logger; 26 | use Ratchet\Http\HttpServer; 27 | use Ratchet\Server\IoServer; 28 | use Ratchet\WebSocket\WsServer; 29 | use React\EventLoop\Loop; 30 | use React\Http\Message\Response; 31 | use Xibo\Controller\Api; 32 | use Xibo\Controller\Relay; 33 | use Xibo\Controller\Server; 34 | use Xibo\Entity\Queue; 35 | 36 | require 'vendor/autoload.php'; 37 | 38 | // TODO: ratchet does not support PHP8 39 | error_reporting(E_ALL ^ E_DEPRECATED); 40 | ini_set('display_errors', 0); 41 | 42 | set_error_handler(function($severity, $message, $file, $line) { 43 | if (!(error_reporting() & $severity)) { 44 | // This error code is not included in error_reporting 45 | return; 46 | } 47 | throw new ErrorException($message, 0, $severity, $file, $line); 48 | }); 49 | 50 | // Decide where to look for the config file 51 | $dirname = (Phar::running(false) == '') ? __DIR__ : dirname(Phar::running(false)); 52 | $config = $dirname . '/config.json'; 53 | 54 | if (!file_exists($config)) { 55 | throw new InvalidArgumentException('Missing ' . $config . ' file, please create one in ' . $dirname); 56 | } 57 | 58 | $configString = file_get_contents($config); 59 | $config = json_decode($configString); 60 | 61 | if ($config === null) { 62 | throw new InvalidArgumentException('Cannot decode config file ' . json_last_error_msg() . ' config string is [' . $configString . ']'); 63 | } 64 | 65 | $logLevel = $config->debug ? Logger::DEBUG : Logger::WARNING; 66 | 67 | // Set up logging to file 68 | $log = new Logger('xmr'); 69 | $log->pushHandler(new StreamHandler(STDOUT, $logLevel)); 70 | 71 | // Queue settings 72 | $queuePoll = $config->queuePoll ?? 5; 73 | $queueSize = $config->queueSize ?? 10; 74 | 75 | // Create a client to relay messages 76 | $relay = new Relay( 77 | $log, 78 | $config->relayMessages ?? '', 79 | $config->relayOldMessages ?? '', 80 | ); 81 | 82 | // Create an in memory message queue. 83 | $messageQueue = new Queue(); 84 | 85 | try { 86 | $loop = Loop::get(); 87 | 88 | // Private API 89 | // ----------- 90 | // Create a private API to receive messages from the CMS 91 | $api = new Api($messageQueue, $log, $relay); 92 | 93 | // Create a HTTP server to handle requests to the API 94 | $http = new React\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterface $request) use ($log, $api) { 95 | try { 96 | if ($request->getMethod() !== 'POST') { 97 | throw new Exception('Method not allowed'); 98 | } 99 | 100 | $json = json_decode($request->getBody()->getContents(), true); 101 | if ($json === false || !is_array($json)) { 102 | throw new InvalidArgumentException('Not valid JSON'); 103 | } 104 | 105 | return $api->handleMessage($json); 106 | } catch (Exception $e) { 107 | $log->error('API: e = ' . $e->getMessage()); 108 | return new Response( 109 | 422, 110 | ['Content-Type' => 'plain/text'], 111 | $e->getMessage() 112 | ); 113 | } 114 | }); 115 | $socket = new React\Socket\SocketServer($config->sockets->api); 116 | $http->listen($socket); 117 | $http->on('error', function (Exception $exception) use ($log) { 118 | $log->error('http: ' . $exception->getMessage()); 119 | }); 120 | 121 | $log->info('HTTP listening'); 122 | 123 | // WS 124 | // ---- 125 | // Web Socket server 126 | $messagingServer = new Server($messageQueue, $log); 127 | $wsSocket = new React\Socket\SocketServer($config->sockets->ws); 128 | $wsServer = new WsServer($messagingServer); 129 | $ioServer = new IoServer( 130 | new HttpServer($wsServer), 131 | $wsSocket, 132 | $loop 133 | ); 134 | 135 | // Enable keep alive 136 | $wsServer->enableKeepAlive($ioServer->loop); 137 | 138 | $log->info('WS listening on ' . $config->sockets->ws); 139 | 140 | // PUB/SUB 141 | // ------- 142 | // LEGACY: Pub socket for messages to Players (subs) 143 | if ($relay->isRelayOld()) { 144 | $log->info('Legacy: relaying old messages'); 145 | 146 | $publisher = null; 147 | $relay->configureZmq(); 148 | } else { 149 | $log->info('Legacy: handling old messages'); 150 | 151 | $publisher = (new React\ZMQ\Context($loop))->getSocket(ZMQ::SOCKET_PUB); 152 | 153 | // Set PUB socket options 154 | if (isset($config->ipv6PubSupport) && $config->ipv6PubSupport === true) { 155 | $log->debug('Pub MQ Setting socket option for IPv6 to TRUE'); 156 | $publisher->setSockOpt(\ZMQ::SOCKOPT_IPV6, true); 157 | } 158 | 159 | foreach ($config->sockets->zmq as $pubOn) { 160 | $log->info(sprintf('Bind to %s for Publish.', $pubOn)); 161 | $publisher->bind($pubOn); 162 | } 163 | } 164 | 165 | // Queue Processor 166 | // --------------- 167 | $log->debug('Adding a queue processor for every ' . $queuePoll . ' seconds'); 168 | $loop->addPeriodicTimer($queuePoll, function() use ($log, $messagingServer, $relay, $publisher, $messageQueue, $queueSize) { 169 | // Is there work to be done 170 | if ($messageQueue->hasItems()) { 171 | $log->debug('Queue Poll - work to be done.'); 172 | 173 | $messageQueue->sortQueue(); 174 | 175 | $log->debug('Queue Poll - message queue sorted'); 176 | 177 | // Send up to X messages. 178 | for ($i = 0; $i < $queueSize; $i++) { 179 | if ($i > $messageQueue->queueSize()) { 180 | $log->debug('Queue Poll - queue size reached'); 181 | break; 182 | } 183 | 184 | // Pop an element 185 | $msg = $messageQueue->getItem(); 186 | 187 | // Send 188 | $log->debug('Sending ' . $i); 189 | 190 | // Where are we sending this item? 191 | if ($msg->isWebSocket) { 192 | $display = $messagingServer->getDisplayById($msg->channel); 193 | if ($display === null) { 194 | if ($relay->isRelay()) { 195 | $relay->relay($msg); 196 | } else { 197 | $log->info('Display ' . $msg->channel . ' not connected'); 198 | } 199 | } else { 200 | $display->connection->send($msg->message); 201 | } 202 | } else if ($relay->isRelayOld()) { 203 | $relay->relay($msg); 204 | } else if ($publisher !== null) { 205 | $publisher->sendmulti([$msg->channel, $msg->key, $msg->message], \ZMQ::MODE_DONTWAIT); 206 | } else { 207 | $log->error('No route to send'); 208 | } 209 | 210 | $log->debug('Popped ' . $i . ' from the queue, new queue size ' . $messageQueue->queueSize()); 211 | } 212 | } 213 | }); 214 | 215 | // Periodic updater 216 | $loop->addPeriodicTimer(30, function() use ($log, $messagingServer, $publisher) { 217 | $log->debug('Heartbeat...'); 218 | 219 | // Send to all connected WS clients 220 | $messagingServer->heartbeat(); 221 | 222 | // Send to PUB queue 223 | $publisher?->sendmulti(["H", "", ""], \ZMQ::MODE_DONTWAIT); 224 | }); 225 | 226 | // Key management 227 | $loop->addPeriodicTimer(3600, function() use ($log, $messageQueue) { 228 | $log->debug('Key management...'); 229 | $messageQueue->expireKeys(); 230 | }); 231 | 232 | // Run the React event loop 233 | $loop->run(); 234 | } catch (Exception $e) { 235 | $log->error($e->getMessage()); 236 | $log->error($e->getTraceAsString()); 237 | } 238 | 239 | // This ends - causing Docker to restart if we're in a container. -------------------------------------------------------------------------------- /src/Controller/Api.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | namespace Xibo\Controller; 23 | 24 | use Psr\Log\LoggerInterface; 25 | use React\Http\Message\Response; 26 | use Xibo\Entity\Queue; 27 | 28 | class Api 29 | { 30 | public function __construct( 31 | private readonly Queue $queue, 32 | private readonly LoggerInterface $logger, 33 | private readonly Relay $relay, 34 | ) { 35 | } 36 | 37 | /** 38 | * Handle messages hitting the API 39 | * @param array $message 40 | * @return \React\Http\Message\Response 41 | */ 42 | public function handleMessage(array $message): Response 43 | { 44 | $type = $message['type'] ?? 'empty'; 45 | 46 | $this->logger->debug('handleMessage: type = ' . $type); 47 | 48 | if ($type === 'stats') { 49 | // Success 50 | return Response::json($this->queue->flushStats()); 51 | } else if ($type === 'keys') { 52 | // Register new keys for this CMS. 53 | $this->queue->addKey($message['id'], $message['key']); 54 | 55 | // Relay new keys. 56 | if ($this->relay->isRelay()) { 57 | $this->relay->relayArray($message); 58 | } 59 | } else if ($type === 'multi') { 60 | $this->logger->debug('Queuing multiple messages'); 61 | foreach ($message['messages'] as $message) { 62 | $this->queue->queueItem($message); 63 | } 64 | } else { 65 | $this->logger->debug('Queuing'); 66 | $this->queue->queueItem($message); 67 | } 68 | 69 | // Success 70 | return new Response(201); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Controller/Relay.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | namespace Xibo\Controller; 24 | 25 | 26 | use GuzzleHttp\Client; 27 | use GuzzleHttp\Exception\GuzzleException; 28 | use Psr\Log\LoggerInterface; 29 | use Xibo\Entity\Message; 30 | 31 | class Relay 32 | { 33 | private readonly ?Client $client; 34 | private ?\ZMQSocket $socket; 35 | 36 | public function __construct( 37 | private readonly LoggerInterface $logger, 38 | private readonly string $relayMessages, 39 | private string $relayOldMessages, 40 | ) { 41 | // Create a client for us to use 42 | if (!empty($this->relayMessages) && $this->relayMessages !== 'false') { 43 | $this->client = new Client([ 44 | 'base_uri' => $this->relayMessages, 45 | ]); 46 | } else { 47 | $this->client = null; 48 | } 49 | } 50 | 51 | public function configureZmq(): void 52 | { 53 | // Create a socket for us to use. 54 | try { 55 | $this->socket = (new \ZMQContext())->getSocket(\ZMQ::SOCKET_REQ); 56 | $this->socket->setSockOpt(\ZMQ::SOCKOPT_LINGER, 2000); 57 | $this->socket->connect($this->relayOldMessages); 58 | } catch (\Exception $exception) { 59 | $this->socket = null; 60 | $this->relayOldMessages = null; 61 | 62 | $this->logger->critical('Unable to connect to old message relay: ' 63 | . $this->relayOldMessages . ', e = ' . $exception->getMessage()); 64 | } 65 | } 66 | 67 | public function disconnect(): void 68 | { 69 | // If we are connected, then 70 | if ($this->socket !== null) { 71 | try { 72 | $this->socket->disconnect($this->relayOldMessages); 73 | } catch (\Exception $exception) { 74 | $this->socket = null; 75 | $this->relayOldMessages = null; 76 | 77 | $this->logger->critical('Unable to disconnect from old message relay: ' 78 | . $this->relayOldMessages . ', e = ' . $exception->getMessage()); 79 | } 80 | } 81 | } 82 | 83 | private function reconnect(): void 84 | { 85 | $this->disconnect(); 86 | $this->configureZmq(); 87 | } 88 | 89 | public function isRelay(): bool 90 | { 91 | return !empty($this->relayMessages) && $this->relayMessages !== 'false'; 92 | } 93 | 94 | public function isRelayOld(): bool 95 | { 96 | return !empty($this->relayOldMessages) && $this->relayOldMessages !== 'false'; 97 | } 98 | 99 | /** 100 | * Relay a message appropriately 101 | * @param \Xibo\Entity\Message $message 102 | * @return void 103 | */ 104 | public function relay(Message $message): void 105 | { 106 | if ($message->isWebSocket) { 107 | $this->relayArray($message->jsonSerialize()); 108 | } else { 109 | try { 110 | $this->socket->send(json_encode($message)); 111 | } catch (\ZMQSocketException $socketException) { 112 | $this->logger->error('relay: send [' . $socketException->getCode() . '] ' . $socketException->getMessage()); 113 | if ($socketException->getCode() === 156384763) { 114 | // Socket state error, reconnect. 115 | // We will drop this message 116 | $this->reconnect(); 117 | } 118 | return; 119 | } 120 | 121 | $retries = 15; 122 | 123 | do { 124 | try { 125 | $reply = $this->socket->recv(\ZMQ::MODE_DONTWAIT); 126 | 127 | if ($reply !== false) { 128 | break; 129 | } 130 | } catch (\ZMQSocketException $socketException) { 131 | $this->logger->error('relay: recv [' . $socketException->getCode() . '] ' . $socketException->getMessage()); 132 | if ($socketException->getCode() === 156384763) { 133 | // Socket state error, reconnect. 134 | // We will drop this message 135 | $this->reconnect(); 136 | } 137 | break; 138 | } 139 | 140 | usleep(100000); 141 | } while (--$retries); 142 | } 143 | } 144 | 145 | /** 146 | * Relay array (only ever a message over private API) 147 | * @param array $message 148 | * @return void 149 | */ 150 | public function relayArray(array $message): void 151 | { 152 | try { 153 | $this->client?->post('/', [ 154 | 'json' => $message, 155 | ]); 156 | } catch (GuzzleException | \Exception $e) { 157 | $this->logger->error('relayArray: Unable to relay, e = ' . $e->getMessage()); 158 | } 159 | } 160 | } -------------------------------------------------------------------------------- /src/Controller/Server.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | namespace Xibo\Controller; 23 | 24 | use Psr\Log\LoggerInterface; 25 | use Ratchet\ConnectionInterface; 26 | use Ratchet\MessageComponentInterface; 27 | use Xibo\Entity\Display; 28 | use Xibo\Entity\Queue; 29 | use XiboSignage\Client\Client; 30 | 31 | class Server implements MessageComponentInterface 32 | { 33 | /** @var Display[] */ 34 | private array $displays = []; 35 | private array $ids = []; 36 | 37 | public function __construct( 38 | private readonly Queue $queue, 39 | private readonly LoggerInterface $logger 40 | ) { 41 | } 42 | 43 | public function onOpen(ConnectionInterface $conn): void 44 | { 45 | $this->logger->debug('onOpen: ' . $conn->resourceId); 46 | 47 | $this->addDisplay( 48 | $conn->resourceId, 49 | $conn 50 | ); 51 | } 52 | 53 | public function onClose(ConnectionInterface $conn): void 54 | { 55 | $this->removeDisplay($conn->resourceId); 56 | $this->logger->debug('onClose: ' . $conn->resourceId); 57 | } 58 | 59 | public function onError(ConnectionInterface $conn, \Exception $e): void 60 | { 61 | $this->logger->debug('onError: ' . $conn->resourceId . ', e: ' . $e->getMessage()); 62 | } 63 | 64 | public function onMessage(ConnectionInterface $from, $msg): void 65 | { 66 | $display = $this->getDisplayByResourceId($from->resourceId); 67 | 68 | $this->logger->debug('onMessage: ' . $display->resourceId); 69 | 70 | // Expect a JSON string 71 | $json = json_decode($msg, true); 72 | if ($json === null) { 73 | $this->logger->error('onMessage: Invalid JSON'); 74 | return; 75 | } 76 | 77 | // We are only expecting one message, which initialises the connection. 78 | try { 79 | if (($json['type'] ?? 'empty') === 'init') { 80 | // The display should pass us a key 81 | $key = $json['key'] ?? null; 82 | if (empty($key)) { 83 | throw new \InvalidArgumentException('Missing key'); 84 | } 85 | 86 | $channel = $json['channel'] ?? null; 87 | if (empty($channel)) { 88 | throw new \InvalidArgumentException('Missing channel'); 89 | } 90 | 91 | // Validate the key provided 92 | if (!$this->queue->authKey($key)) { 93 | throw new \InvalidArgumentException('Invalid key'); 94 | } 95 | 96 | // Valid key for the CMS 97 | $this->linkDisplay($display, $channel); 98 | } else { 99 | throw new \Exception('Invalid message type'); 100 | } 101 | } catch (\Exception $e) { 102 | $this->logger->error('onMessage: ' . $e->getMessage()); 103 | 104 | // Close the socket with an error (onClose gets called to remove the connection) 105 | $display->connection->close(); 106 | } 107 | } 108 | 109 | public function heartbeat(): void 110 | { 111 | foreach ($this->displays as $display) { 112 | if ($display->id !== null) { 113 | $display->connection->send('H'); 114 | } 115 | } 116 | } 117 | 118 | /** 119 | * Add a display to the list of connections (unauthed at this point) 120 | * @param string $resourceId 121 | * @param \Ratchet\ConnectionInterface $connection 122 | * @return \Xibo\Entity\Display 123 | */ 124 | private function addDisplay(string $resourceId, ConnectionInterface $connection): Display 125 | { 126 | $this->displays[$resourceId] = new Display($resourceId, $connection); 127 | return $this->displays[$resourceId]; 128 | } 129 | 130 | /** 131 | * Link a display to an ID (which is the channel) 132 | * @param \Xibo\Entity\Display $display 133 | * @param string $id 134 | * @return void 135 | */ 136 | private function linkDisplay(Display $display, string $id): void 137 | { 138 | // Make a pointer between this resource and the ID 139 | $this->ids[$id] = $display->resourceId; 140 | $display->id = $id; 141 | } 142 | 143 | /** 144 | * Remove a display 145 | * @param string $resourceId 146 | * @return void 147 | */ 148 | private function removeDisplay(string $resourceId): void 149 | { 150 | $display = $this->getDisplayByResourceId($resourceId); 151 | if ($display !== null && $display->id !== null) { 152 | unset($this->ids[$display->id]); 153 | } 154 | unset($this->displays[$resourceId]); 155 | } 156 | 157 | /** 158 | * Get a display by its ID (channel) 159 | * @param string $id 160 | * @return \Xibo\Entity\Display|null 161 | */ 162 | public function getDisplayById(string $id): ?Display 163 | { 164 | if (isset($this->ids[$id])) { 165 | return $this->displays[$this->ids[$id]] ?? null; 166 | } else { 167 | return null; 168 | } 169 | } 170 | 171 | /** 172 | * Get a display by its socket resource 173 | * @param string $resourceId 174 | * @return \Xibo\Entity\Display|null 175 | */ 176 | private function getDisplayByResourceId(string $resourceId): ?Display 177 | { 178 | return $this->displays[$resourceId] ?? null; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/Entity/Display.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | namespace Xibo\Entity; 23 | 24 | use Ratchet\ConnectionInterface; 25 | 26 | class Display 27 | { 28 | public ?string $id = null; 29 | 30 | public function __construct( 31 | public string $resourceId, 32 | public ConnectionInterface $connection 33 | ) { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Entity/Message.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | namespace Xibo\Entity; 23 | 24 | class Message implements \JsonSerializable 25 | { 26 | public string $channel; 27 | public string $key; 28 | public string $message; 29 | public int $qos; 30 | public bool $isWebSocket; 31 | 32 | public function jsonSerialize(): array 33 | { 34 | return [ 35 | 'channel' => $this->channel, 36 | 'key' => $this->key, 37 | 'message' => $this->message, 38 | 'qos' => $this->qos, 39 | 'isWebSocket' => $this->isWebSocket, 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Entity/Queue.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | namespace Xibo\Entity; 24 | 25 | class Queue 26 | { 27 | private array $instances = []; 28 | 29 | /** @var \Xibo\Entity\Message[] */ 30 | private array $queue; 31 | 32 | private array $stats; 33 | 34 | public function __construct() 35 | { 36 | $this->queue = []; 37 | $this->stats = [ 38 | 'peakQueueSize' => 0, 39 | 'messageCounters' => [ 40 | 'total' => 0, 41 | 'sent' => 0, 42 | 'qos1' => 0, 43 | 'qos2' => 0, 44 | 'qos3' => 0, 45 | 'qos4' => 0, 46 | 'qos5' => 0, 47 | 'qos6' => 0, 48 | 'qos7' => 0, 49 | 'qos8' => 0, 50 | 'qos9' => 0, 51 | 'qos10' => 0, 52 | ] 53 | ]; 54 | 55 | } 56 | 57 | public function hasItems(): bool 58 | { 59 | return count($this->queue); 60 | } 61 | 62 | public function queueSize(): int 63 | { 64 | return count($this->queue); 65 | } 66 | 67 | public function sortQueue(): void 68 | { 69 | // Order the message queue according to QOS 70 | usort($this->queue, function($a, $b) { 71 | return ($a->qos === $b->qos) ? 0 : (($a->qos < $b->qos) ? -1 : 1); 72 | }); 73 | } 74 | 75 | public function getItem(): Message 76 | { 77 | $this->stats['messageCounters']['sent']++; 78 | 79 | return array_pop($this->queue); 80 | } 81 | 82 | /** 83 | * @param array $message 84 | * @return void 85 | * @throws \InvalidArgumentException 86 | */ 87 | public function queueItem(array $message): void 88 | { 89 | $msg = new Message(); 90 | 91 | if (!isset($message['channel'])) { 92 | throw new \InvalidArgumentException('Missing Channel'); 93 | } 94 | 95 | if (!isset($message['key'])) { 96 | throw new \InvalidArgumentException('Missing Key'); 97 | } 98 | 99 | if (!isset($message['message'])) { 100 | throw new \InvalidArgumentException('Missing Message'); 101 | } 102 | 103 | // Make sure QOS is set 104 | if (!isset($message['qos'])) { 105 | // Default to the highest priority for messages missing a QOS 106 | $message['qos'] = 10; 107 | } 108 | 109 | $msg->channel = $message['channel']; 110 | $msg->key = $message['key']; 111 | $msg->message = $message['message']; 112 | $msg->qos = $message['qos']; 113 | $msg->isWebSocket = $message['isWebSocket'] ?? false; 114 | 115 | // Queue 116 | $this->queue[] = $msg; 117 | 118 | // Update stats 119 | $this->stats['messageCounters']['total']++; 120 | $this->stats['messageCounters']['qos' . $msg->qos]++; 121 | 122 | $currentQueueSize = $this->queueSize(); 123 | if ($currentQueueSize > $this->stats['peakQueueSize']) { 124 | $this->stats['peakQueueSize'] = $currentQueueSize; 125 | } 126 | } 127 | 128 | public function flushStats(): array 129 | { 130 | $stats = $this->stats; 131 | $stats['currentQueueSize'] = $this->queueSize(); 132 | $this->clearStats(); 133 | return $stats; 134 | } 135 | 136 | private function clearStats(): void 137 | { 138 | $this->stats = [ 139 | 'peakQueueSize' => 0, 140 | 'messageCounters' => [ 141 | 'total' => 0, 142 | 'sent' => 0, 143 | 'qos1' => 0, 144 | 'qos2' => 0, 145 | 'qos3' => 0, 146 | 'qos4' => 0, 147 | 'qos5' => 0, 148 | 'qos6' => 0, 149 | 'qos7' => 0, 150 | 'qos8' => 0, 151 | 'qos9' => 0, 152 | 'qos10' => 0, 153 | ] 154 | ]; 155 | } 156 | 157 | /** 158 | * Add key. 159 | * called by a CMS to indicate that it has generated a new key, or is refreshing an old key. 160 | * @param string $instance 161 | * @param string $key 162 | * @return void 163 | */ 164 | public function addKey(string $instance, string $key): void 165 | { 166 | if (!array_key_exists($instance, $this->instances)) { 167 | $this->instances[$instance] = ['keys' => []]; 168 | } 169 | 170 | // If a key already exists push the expiry time 171 | foreach ($this->instances[$instance]['keys'] as $index => $existingKey) { 172 | if ($existingKey['key'] === $key) { 173 | $this->instances[$instance]['keys'][$index]['expires'] = time() + 3600; 174 | return; 175 | } 176 | } 177 | 178 | // Not found 179 | $this->instances[$instance]['keys'][] = [ 180 | 'key' => $key, 181 | 'expires' => time() + 86400, 182 | ]; 183 | } 184 | 185 | /** 186 | * Authenticate the provided key against our list of valid keys 187 | * @param string $providedKey 188 | * @return bool 189 | */ 190 | public function authKey(string $providedKey): bool 191 | { 192 | foreach ($this->instances as $instance) { 193 | foreach ($instance['keys'] as $key) { 194 | if ($key['key'] === $providedKey && time() < $key['expires']) { 195 | return true; 196 | } 197 | } 198 | } 199 | 200 | return false; 201 | } 202 | 203 | /** 204 | * Key maintenance to remove keys which have expired 205 | * @return void 206 | */ 207 | public function expireKeys(): void 208 | { 209 | // Expire keys within each instance 210 | foreach ($this->instances as $instanceKey => $instance) { 211 | foreach ($instance['keys'] as $key => $value) { 212 | // Expire any keys which are no longer in date. 213 | if (time() >= $value['expires']) { 214 | unset($instance['keys'][$key]); 215 | } 216 | } 217 | 218 | // Remove instances with no keys 219 | if (count($instance['keys']) <= 0) { 220 | unset($this->instances[$instanceKey]); 221 | } 222 | } 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /tests/Private API.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8081 2 | Content-Type: application/json 3 | 4 | { 5 | "type": "stats" 6 | } 7 | 8 | ### 9 | 10 | POST http://localhost:8081 11 | Content-Type: application/json 12 | 13 | { 14 | "type": "keys", 15 | "id": "http://localhost", 16 | "key": "123456" 17 | } 18 | 19 | ### 20 | -------------------------------------------------------------------------------- /tests/cmsSend.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | // execute with: docker-compose exec xmr sh -c "cd /opt/xmr/tests; php cmsSend.php 1234" 24 | require '../vendor/autoload.php'; 25 | $_MESSAGE_COUNT = 15; 26 | $_ENCRYPT = false; 27 | 28 | // Track 29 | $start = microtime(true); 30 | 31 | if (!isset($argv[1])) { 32 | die('Missing player identity' . PHP_EOL); 33 | } 34 | 35 | $identity = $argv[1]; 36 | $isWebSocket = ($argv[2] ?? false) === 'websocket'; 37 | 38 | // Get the Public Key 39 | $fp = fopen('key.pub', 'r'); 40 | $publicKey = openssl_get_publickey(fread($fp, 8192)); 41 | fclose($fp); 42 | 43 | try { 44 | //open connection 45 | $ch = curl_init(); 46 | 47 | //set the url, number of POST vars, POST data 48 | curl_setopt($ch,CURLOPT_URL, 'http://localhost:8081'); 49 | curl_setopt($ch,CURLOPT_POST, true); 50 | curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); 51 | 52 | // So that curl_exec returns the contents of the cURL; rather than echoing it 53 | curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 54 | 55 | // Queue up a bunch of messages to see what happens 56 | for ($i = 0; $i < $_MESSAGE_COUNT; $i++) { 57 | // Reference params 58 | $message = null; 59 | $eKeys = null; 60 | 61 | if ($_ENCRYPT) { 62 | // Encrypt a message 63 | openssl_seal($i . ' - QOS1', $message, $eKeys, [$publicKey], 'RC4'); 64 | 65 | // Create a message and send. 66 | $fields = [ 67 | 'channel' => $identity, 68 | 'key' => base64_encode($eKeys[0]), 69 | 'message' => base64_encode($message), 70 | 'qos' => rand(1, 10), 71 | 'isWebSocket' => $isWebSocket, 72 | ]; 73 | } else { 74 | $fields = [ 75 | 'channel' => $identity, 76 | 'key' => 'key', 77 | 'message' => 'message ' . $i, 78 | 'qos' => rand(1, 10), 79 | 'isWebSocket' => $isWebSocket, 80 | ]; 81 | } 82 | 83 | 84 | curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields)); 85 | 86 | //execute post 87 | $result = curl_exec($ch); 88 | echo $result . PHP_EOL; 89 | 90 | usleep(50); 91 | } 92 | } catch (Exception $e) { 93 | echo $e->getMessage() . PHP_EOL; 94 | } 95 | 96 | $end = microtime(true); 97 | echo PHP_EOL . 'Duration: ' . ($end - $start) . ', Start: ' . $start . ', End: ' . $end . PHP_EOL; 98 | 99 | /** 100 | * @param $socket 101 | * @param $message 102 | * @return bool|string 103 | * @throws ZMQSocketException 104 | */ 105 | function send($socket, $message) 106 | { 107 | // Send the message to the socket 108 | $socket->send(json_encode($message)); 109 | 110 | // Need to replace this with a non-blocking recv() with a retry loop 111 | $retries = 15; 112 | $reply = false; 113 | 114 | do { 115 | try { 116 | // Try and receive 117 | // if ZMQ::MODE_NOBLOCK/MODE_DONTWAIT is used and the operation would block boolean false 118 | // shall be returned. 119 | $reply = $socket->recv(\ZMQ::MODE_DONTWAIT); 120 | 121 | if ($reply !== false) 122 | break; 123 | 124 | echo '.'; 125 | } catch (\ZMQSocketException $sockEx) { 126 | if ($sockEx->getCode() !== \ZMQ::ERR_EAGAIN) 127 | throw $sockEx; 128 | } 129 | 130 | usleep(100000); 131 | 132 | } while (--$retries); 133 | 134 | return $reply; 135 | } 136 | -------------------------------------------------------------------------------- /tests/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEA1qtMQkDW2x+ELIbmYLHcQJA1tNpBf8Cl24B7/iRAF16C68t5 3 | os5Vfa7fqkoq1hkbFsCeaRs4hNMSjLPc3JB1rDoVgvORATrRlgsWRIUgd38RwWem 4 | 6AffB18pFJDiLH2o2QNdeDP1bzdrRA7JywL4GLL9Xw6MPj20qTqfPWtOCZM7dMzA 5 | RpUlFOXbhvRNVGbLcn1tNoHXJmJoGaTT9ndDbbuk00/SUxsvublyB1tlrD/M8V8X 6 | 2+6c8+XdFTzxZMpBXU/6pGsg/kVFZ6apcetau4/rSozobdII788DkeI96Mj0pu8O 7 | cCm9Ov3eN9wXhoNwo1wBRe9w/+svyD+gF+DaKQIDAQABAoIBAA2jrKC5Be2+PuOl 8 | XpXeNyRTBVaMV4UKdH9R1o77NqdFdgQNVZkmiwAFUGi9daNMzQ/RBT+gXyLxVkhi 9 | VTIea5uZxSwg1aHCXvatlaic3Mc656HmOBCeD2mkfjO0UOqKwWOodxPgGUQLvWEB 10 | n4iqk6DeHoMfpYF+4i+ubde1Lawl9NXls5xHWxeNaIaDnQSj9YlzMnx4Y1Q4YQxM 11 | QWBv6HgMAuJ+72/PrwdZs5iovc7zBiP0BsLSoT0rqnz6VTFWrzsUoz4/4x7Lwnk4 12 | zQw2kcDAmvKJa2nH94wm+F8mpU5HYcQJofsPNb1+5w7q0uXwqhsIsti/Pn8Rino0 13 | JhbtWBECgYEA+JEZYJcsPgnKQLIiycaS3j/IBromYe0n0OTGj9b0L69RuZJK5fze 14 | utAzEBro+/SZaqi5/B4377SLn7Dqej+f6N4wH/9siBNt/gNq0ddEZmOfwcZ0Dy/+ 15 | nsFny0EB2zKdW/XIBcdhpAwtPOyIxit9J1sWSi6NO09kEgE0Msgl6TMCgYEA3Ray 16 | DS5d3/qZwXHzeq91XEQfo/xNsulS28ad+o0cuEPq2Gj96y8wemG7z7Qcb6Nu/Ep6 17 | pMmtkvJTIRJhlC8CeNliWtX8TMOQIXW9DiKrA6HQdRC9P1irP6FWdyPvHNBw8UII 18 | 6GbNdZq7sWm0GP5XMLWIfTY9nVMTr59KXSNBBzMCgYEAwUOwQ5XG5IWgKCVZPyGS 19 | WBOnZvOdnE5UwureKECto9Xg6TSB38h5NS9kRIVn2V8ZWgDOeuTUASCT3xojdeG6 20 | Z8k6CecDb9oLj5EAoR+LI0EamgO/gX+DrdQa68Iju1bjWvkDCNs5Y9/D3LbcsZhm 21 | uw7ricogLZlQ6V7eQw2zzFkCgYAudbJ86p13j+X3rMaJpY14EijEASUiz71Fyfsw 22 | x66dWkhjqcySO5xoW1loUGUZYLLV+aDEOE1tb9bgQEiZJzfRxXzRsd4PE5maLm/I 23 | JKjjXoG72ASs5yk1eeX9q2N4HqVdTY8pp1DNwfJnWdsq1WflKIDCLz/La8XbRhIO 24 | eHYV2QKBgBpv2bjubTsDSz7VXCxxXDCyTTTKcJ1A87KL3QmfoTgWb7KvcsxK7yXx 25 | s7zifeDQY3fvsRw41D+BdyLkRyGn7JnmGLmUaQAPXhGwVmblgLlM3WyQHZWjakjC 26 | YBM/5wrxvEUBjAup/9AEbl9Wy4i6x6K5J0mLf7mC3UfA+9+/3wGE 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /tests/key.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1qtMQkDW2x+ELIbmYLHc 3 | QJA1tNpBf8Cl24B7/iRAF16C68t5os5Vfa7fqkoq1hkbFsCeaRs4hNMSjLPc3JB1 4 | rDoVgvORATrRlgsWRIUgd38RwWem6AffB18pFJDiLH2o2QNdeDP1bzdrRA7JywL4 5 | GLL9Xw6MPj20qTqfPWtOCZM7dMzARpUlFOXbhvRNVGbLcn1tNoHXJmJoGaTT9ndD 6 | bbuk00/SUxsvublyB1tlrD/M8V8X2+6c8+XdFTzxZMpBXU/6pGsg/kVFZ6apceta 7 | u4/rSozobdII788DkeI96Mj0pu8OcCm9Ov3eN9wXhoNwo1wBRe9w/+svyD+gF+Da 8 | KQIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /tests/playerSub.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | // docker-compose exec xmr sh -c "cd /opt/xmr/tests; php playerSub.php 1234" 23 | // docker-compose exec xmr sh -c "cd /opt/xmr/tests; php playerSub.php 1234 websocket" 24 | require '../vendor/autoload.php'; 25 | 26 | if (!isset($argv[1])) { 27 | die('Missing player identity' . PHP_EOL); 28 | } 29 | 30 | $identity = $argv[1]; 31 | 32 | $fp = fopen('key.pem', 'r'); 33 | $privateKey = openssl_get_privatekey(fread($fp, 8192)); 34 | fclose($fp); 35 | 36 | echo 'Sub to: ' . $identity . PHP_EOL; 37 | 38 | // Sub 39 | $loop = React\EventLoop\Factory::create(); 40 | 41 | $context = new React\ZMQ\Context($loop); 42 | 43 | $sub = $context->getSocket(ZMQ::SOCKET_SUB); 44 | $sub->connect('tcp://localhost:9505'); 45 | $sub->subscribe("H"); 46 | $sub->subscribe($identity); 47 | 48 | $sub->on('messages', function ($msg) use ($identity, $privateKey) { 49 | try { 50 | echo '[' . date('Y-m-d H:i:s') . '] Received: ' . json_encode($msg) . PHP_EOL; 51 | 52 | if ($msg[0] == "H") { 53 | return; 54 | } 55 | 56 | // Expect messages to have a length of 3 57 | if (count($msg) != 3) { 58 | throw new InvalidArgumentException('Incorrect Message Length'); 59 | } 60 | 61 | // Message will be: channel, key, message 62 | if ($msg[0] != $identity) { 63 | throw new InvalidArgumentException('Channel does not match'); 64 | } 65 | } 66 | catch (InvalidArgumentException $e) { 67 | echo $e->getMessage() . PHP_EOL; 68 | } 69 | }); 70 | 71 | $loop->run(); 72 | 73 | openssl_free_key($privateKey); --------------------------------------------------------------------------------