Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching a TCP stream for output over Gopher and HTTP
<?php
header('Content-Type: image/gif');
$fp = fsockopen("marang.room205.org", 8091, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
from pygopherd.handlers.pyg import PYGBase
from pygopherd.gopherentry import GopherEntry
from socket import *
class PYGMain(PYGBase):
def canhandlerequest(self):
return 1
def getentry(self):
entry = GopherEntry(self.selector, self.config)
entry.type = 'g'
entry.mimetype = 'image/gif'
entry.name = 'Room 205 Webcam'
entry.setea('VIEWS', 'image/gif')
entry.setgopherpsupport(1)
return entry
def write(self, wfile):
host = 'marang.room205.org'
port = 8091
s = socket(AF_INET, SOCK_STREAM)
s.connect((host, port))
while True:
wfile.write(s.recv(1024))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.