Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An example of using phpws (websocket) to make a file streamer. Client & server side example is provided. Original library code in the link below. Works with the latest Chrome.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
.gitignore
README.md
client.php
client1.html
demo.php
demo_client.php
demo_ssl.php
democert.pem
websocket.admin.php
websocket.client.php
websocket.exceptions.php
websocket.framing.php
websocket.functions.php
websocket.message.php
websocket.protocol.php
websocket.resources.php
websocket.server.php
websocket.socket.php
websocket.users.php

README.md

File Streamer (server & client) Sample

Based on

based on code from phpws, which is a php based websocket library

Requirements

  • apache & php
  • ability to listen on port 12345, used by websocket
  • a web browser
  • on windows, make sure that the hosts file contains the line with 127.0.0.1 loalhost

Tested on

  • Windows 7
  • with latest Xampp for Windows, a bundled php/apache package for windows, comes w/ php 5.4
  • Chrome 22, which is the latest as of time of writing.

Prepration

  • You can put the php files under /var/www/html in linux or somewhere in htdocs if running on windows
  • and create the text file to be streamed called sendme.txt in c:\tmp\sendme.txt or /tmp/sendme.txt with the correct read permissions

Running the server

  • go to the directory where the php files are and run

    php -q demo.php

Running the client

Something went wrong with that request. Please try again.