From 19e69366177799f7ccff75b6f4a1850ff0ca8d09 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Dec 2015 11:11:06 +0000 Subject: dtas-mpd-emu: beginning of the MPD emulation proxy 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. --- bin/dtas-mpd-emu | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/dtas-mpd-emu (limited to 'bin/dtas-mpd-emu') 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 +# 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 -- cgit v1.2.3-24-ge0c7