Main Area and Open Discussion > General Software Discussion
tiny http server with podcast feeds?
electronixtar:
Hi all,
I have a Windows Mobile phone with wifi, there's a CorePlayer which could play podcast feeds, now I need a tiny HTTP server under Windows for my laptop, that I specify a movies/mp3 folder, it starts up as a http server, and generate a podcast feed as well as deliver the .avi/.mp3 files. So my phone connect to my laptop via wifi, and I can listening to my mp3 lib everywhere at home.
I know IIS/apache could make it, it's just too big. Any tiny solutions?
Thanks in advance.
Ehtyar:
I can recommend nginx and mongoose. I've had more experience with nginx, and it's quite a widely used, but little known web sever. Let us know what you decide on and if you run into trouble.
Ehtyar.
electronixtar:
I can recommend nginx and mongoose. I've had more experience with nginx, and it's quite a widely used, but little known web sever. Let us know what you decide on and if you run into trouble.
Ehtyar.
-Ehtyar (July 06, 2009, 08:40 PM)
--- End quote ---
mongoose is super cool. Thanks
I need to extend Mongoose to something like
http://127.0.0.1:8080/E/mp3/?format=podcast
or
http://127.0.0.1:8080/E/mp3/?format=m3u
any ideas?
Fixed it with some python script:
--- ---#!/usr/bin/env python
#coding:utf-8
import os
import mongoose
import sys
def m3u_handler(conn, info, data):
conn.printf('%s', 'HTTP/1.0 200 OK\r\n')
conn.printf('%s', 'Content-Type: audio/x-mpegurl\r\n')
r = '#EXTM3U\n\n' + '\n'.join( os.listdir(os.path.join(server.root,info.uri.replace('/:m3u', ''))))
conn.printf('%s', 'Content-Length: %d\r\n\r\n' % len(r))
conn.printf(r)
server = mongoose.Mongoose(ports='80', root='E:/Media') #os.getcwd())
server.set_uri_callback(r'*/:m3u', m3u_handler, 0)
#server.set_error_callback(404, error_404_handler, 0)
# Mongoose options can be retrieved by asking an attribute
print 'Starting Mongoose %s on port(s) %s ' % (server.version, server.ports)
print 'CGI extensions: %s' % server.cgi_ext
# Serve connections until 'enter' key is pressed on a console
sys.stdin.read(1)
# Deleting server object stops all serving threads
print 'Stopping server.'
del server
Usage: run the python script, it will share your E:\Media folder on http://127.0.0.1/
use http://127.0.0.1/:m3u to change the output format to .m3u with correct MIME
4wd:
There's also the always handy HFS and in the forum there's a templates board where people share ones they've made - like the Thunderchicken of Glory.
Ehtyar:
electronixtar: niiiiice :Thmbsup:
Ehtyar.
Navigation
[0] Message Index
[#] Next page
Go to full version