* ereg is deprecated since PHP 5.3
* socket should be closed before return (unreachable code)
Merge pull request #11 from sunchaserinfo/upstream

deprecation warning fix & unreachable code fix
Add license, Fixes #10.
Merge remote-tracking branch 'origin/upstream'

Conflicts:
	index.php
Upstream license confirmed to be MIT, add license comments to new files