Help - Search - Members - Calendar
Full Version: HTTP remote control server
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Uploads - (fb2k)
phyntos
This is a quick and dirty standalone HTTP remote control server.
The interface looks rather crude but as it uses templates it can be customized easily.

Click to view attachment

It provides limited functionality, including
- play, pause, stop, next, previous
- showing the current song and status
- listing the playlist and selecting a song

You will need the foo_controlserver component:
http://www.hydrogenaudio.org/forums/index....showtopic=38114

The listening port and host&port of the machine foobar is running can be configured by editing webfoo.conf.txt
but in most cases the standard values will do it.

With standard configuration, the interface can be accessed through
http://localhost:2000

It's written in Ruby because I wanted to try out that language.
Jut unpack Click to view attachment and run webfoo.exe.

Source:
Click to view attachment

MusicNonStop
Any idea why I always get an "Internal Server Error" for the playlist, when I try to access webfoo from another computer on the LAN? No problem at all when using localhost.. edit: Actually does it randomly on refresh on localhost, too.

The error is "undefined method `[]' for nil:NilClass".

More details:

WebFoo 0.1
HTTP remote interface for foobar2000
Copyright © 2007 by Marcel Schaeben
[2007-07-13 15:27:24] INFO WEBrick 1.3.1
[2007-07-13 15:27:24] INFO ruby 1.8.5 (2006-08-25) [i386-mswin32]
[2007-07-13 15:27:24] INFO WEBrick::HTTPServer#start: pid=3576 port=2000
HTTP server started on port 2000.
Connected to foobar.
localhost - - [13/Jul/2007:15:27:32 FLE Standard Time] "GET /control HTTP/1.1" 200 433
http://127.0.0.1:2000/ -> /control
localhost - - [13/Jul/2007:15:27:32 FLE Standard Time] "GET /playlist HTTP/1.1" 200 69062
http://127.0.0.1:2000/ -> /playlist
localhost - - [13/Jul/2007:15:27:38 FLE Standard Time] "GET /control?cmd=next HTTP/1.1" 200 428
http://127.0.0.1:2000/control -> /control?cmd=next
10.0.0.3 - - [13/Jul/2007:15:28:37 FLE Standard Time] "GET / HTTP/1.1" 200 178 - -> /
10.0.0.3 - - [13/Jul/2007:15:30:06 FLE Standard Time] "GET /favicon.ico HTTP/1.1" 200 178
http://10.0.0.2:2000/ -> /favicon.ico
[2007-07-13 15:30:06] ERROR NoMethodError: undefined method `[]' for nil:NilClass
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\app\webfoo.rb:92:in `getPlaylist'
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\app\webfoo.rb:176
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\app\webfoo.rb:172:in `gsub!'
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\app\webfoo.rb:172
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpservlet/prochandler.rb:26:in `call'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpservlet/prochandler.rb:26:in `do_GET'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpservlet/abstract.rb:35:in `__send__'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpservlet/abstract.rb:35:in `service'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpserver.rb:104:in `service'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/httpserver.rb:65:in `run'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:173:in `start_thread'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:162:in `start'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:162:in `start_thread'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:95:in `start'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:92:in `each'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:92:in `start'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:23:in `start'
C:/DOCUME~1/user/LOCALS~1/Temp/eee.webfoo.exe.8/lib/webrick/server.rb:82:in `start'
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\app\webfoo.rb:189
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\bootstrap.rb:50:in `load'
C:\DOCUME~1\user\LOCALS~1\Temp\eee.webfoo.exe.8\bootstrap.rb:50
10.0.0.3 - - [13/Jul/2007:15:29:13 FLE Standard Time] "GET /control HTTP/1.1" 200 456
http://10.0.0.2:2000/ -> /control
10.0.0.3 - - [13/Jul/2007:15:29:48 FLE Standard Time] "GET /playlist HTTP/1.1" 500 317
http://10.0.0.2:2000/ -> /playlist
MusicNonStop
I compiled the source with latest versions of Ruby and rubyscript2exe, and it seemed to help somewhat. However webfoo still works very slow when accessed from outside localhost.
MusicNonStop

Help.. Anyone?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.