about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-02 11:11:06 +0000
committerEric Wong <e@80x24.org>2016-01-22 06:12:58 +0000
commit19e69366177799f7ccff75b6f4a1850ff0ca8d09 (patch)
treee2de2969aad85337ed0d8d5c3b01ca46e9e006f7 /bin
parenta9fcfdb4ac43ccd625df1667611fa143f155dedc (diff)
downloaddtas-19e69366177799f7ccff75b6f4a1850ff0ca8d09.tar.gz
Get basic commands and output buffering (in-memory) working.
The original mpd buffers large responses into memory, too,
so there probably isn't much concern for DoS-ing with slow
clients like a typical web server has.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dtas-mpd-emu11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/dtas-mpd-emu b/bin/dtas-mpd-emu
new file mode 100755
index 0000000..d95d545
--- /dev/null
+++ b/bin/dtas-mpd-emu
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+# Copyright (C) 2015 all contributors <dtas-all@nongnu.org>
+# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
+
+# MPD protocol emulation proxy in front of dtas-player
+require 'socket'
+require 'dtas/mpd_emu_client'
+require 'dtas/server_loop'
+l = TCPServer.new('127.0.0.1', 2100)
+svc = DTAS::ServerLoop.new([l], DTAS::MpdEmuClient)
+svc.run_forever