Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.
PHP
Branch: master

Update README.md

latest commit f52b2e006d
Joyce Chan authored

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.