This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Websockify is a suite of programs to bridge WebSockets to TCP implemented in different languages. It also includes support resources to simplify WebSocket programming for some older browsers.
- Loading branch information
1 parent
741166a
commit 2708653
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
class Websockify < Formula | ||
homepage "https://github.com/kanaka/websockify" | ||
url "https://github.com/kanaka/websockify/archive/v0.6.0.tar.gz" | ||
sha1 "f2bffebc9e4d94ad3a329638bee63e899eaad9c0" | ||
|
||
depends_on :python if MacOS.version <= :snow_leopard | ||
depends_on "openssl" | ||
|
||
def install | ||
system "make" | ||
|
||
Dir.chdir("other") do | ||
system "make" | ||
end | ||
|
||
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" | ||
system "python", *Language::Python.setup_install_args(libexec) | ||
bin.install Dir["#{libexec}/bin/*"] | ||
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) | ||
|
||
# Install C version of websockify | ||
bin.install "other/websockify" => "websockify-c" | ||
|
||
man1.install "docs/websockify.1" => "websockify.1" | ||
|
||
(doc+"websockify").install "docs" | ||
|
||
# Upstream Bug: Not named ".dylib" | ||
# Issue: https://github.com/kanaka/websockify/issues/156 | ||
lib.install "rebind.so" => "rebind.dylib" | ||
|
||
# rmdir, not rm_r, as this is genuinely empty and we want to fail if the tarball | ||
# ever changes in a new release | ||
rmdir "include/web-socket-js-project" | ||
|
||
(share+"websockify"+"client").install "wsirc.html", "wstelnet.html", "include" | ||
|
||
(share+"websockify").install "other/js" => "node-js" | ||
|
||
(share+"websockify"+"ruby").install "other/websocket.rb", "other/websockify.rb" | ||
|
||
(share+"websockify"+"clojure").install "other/project.clj", "other/websockify.clj" | ||
|
||
# Binaries not installed in bin (as bin.install ):- | ||
# - rebind: coding of discovery of rebind.so needs re-writing | ||
# - other/wswrap: dependency wswrapper.so seems to be missing | ||
# - other/launch.sh: coding of path discovery of dependencies is just too weird to work | ||
(share+"websockify"+"scripts").install "rebind", "other/wswrap" => "wswrap", "other/launch.sh" => "launch.sh" | ||
end | ||
|
||
# This test will fail if either of the ports 50000 or 500001 are in use | ||
test do | ||
system "websockify", "--timeout=1", "127.0.0.1:50000", "127.0.0.1:50001" | ||
end | ||
end |