diff --git a/index.html b/index.html
new file mode 100644
index 0000000..9927c1d
--- /dev/null
+++ b/index.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/serverGet.php b/serverGet.php
new file mode 100644
index 0000000..06adb1f
--- /dev/null
+++ b/serverGet.php
@@ -0,0 +1,72 @@
+
+
+// TODO:
+// - read all files from the folder, not just the first one
+// - look at this one, might demonstrate slightly better: https://shanetully.com/2014/09/a-dead-simple-webrtc-example/
+
+
+// A unique identifier (not necessary when working with websockets)
+if (!isset($_GET['unique'])) {
+ die('no identifier');
+}
+$unique=$_GET['unique'];
+if (strlen($unique)==0 || ctype_digit($unique)===false) {
+ die('not a correct identifier');
+}
+
+
+header('Content-Type: text/event-stream');
+header('Cache-Control: no-cache'); // recommended
+
+function startsWith($haystack, $needle) {
+ return (substr($haystack, 0, strlen($needle) ) === $needle);
+}
+
+// Get a list of all files that start with '_file_' except the file containing
+// messages that this client has sended itsself ('_file_'.$unique).
+$all = array ();
+$handle = opendir ( '../'.basename ( dirname ( __FILE__ ) ) );
+if ($handle !== false) {
+ while ( false !== ($filename = readdir ( $handle )) ) {
+ if (startsWith($filename,'_file_' /* .$room */) && !(startsWith($filename,'_file_' /*.$room*/ .$unique) )) {
+ $all [] .= $filename;
+ }
+ }
+ closedir( $handle );
+}
+
+if (count($all)!=0) {
+
+ // A main lock to ensure save safe writing/reading
+ $mainlock = fopen('serverGet.php','r');
+ if ($mainlock===false) {
+ die('could not create main lock');
+ }
+ flock($mainlock, LOCK_EX);
+
+ // show and empty the first file that is not empty
+ for ($x=0; $x
\ No newline at end of file
diff --git a/serverPost.php b/serverPost.php
new file mode 100644
index 0000000..36670d1
--- /dev/null
+++ b/serverPost.php
@@ -0,0 +1,34 @@
+
+
+// A unique identifier (not necessary when working with websockets)
+if (!isset($_GET['unique'])) {
+ die('no identifier');
+}
+$unique=$_GET['unique'];
+if (strlen($unique)==0 || ctype_digit($unique)===false) {
+ die('not a correct identifier');
+}
+
+
+// A main lock to ensure save safe writing/reading
+$mainlock = fopen('serverGet.php','r');
+if ($mainlock===false) {
+ die('could not create main lock');
+}
+flock($mainlock, LOCK_EX);
+
+// Add the new message to file
+$filename = '_file_' /*.$room*/ . $unique;
+$file = fopen($filename,'ab');
+if (filesize($filename)!=0) {
+ fwrite($file,'_MULTIPLEVENTS_');
+}
+$posted = file_get_contents('php://input');
+fwrite($file,$posted);
+fclose($file);
+
+// Unlock main lock
+flock($mainlock,LOCK_UN);
+fclose($mainlock);
+
+?>
\ No newline at end of file