使用SimpleHTTPServer音频/视频流失败

Jik*_*ose 12 python streaming simplehttpserver ios

我通过调用服务器将文件夹中的文件共享给其他设备python -m SimpleHTTPServer.

我只是试图流使用此与它的视频/音频(标准MP4和MP3,无论是在20MB)到另一台计算机WORKS(但在终端抛出的错误(下上市)).

不知何故,视频/音频失败(除了非常小的mp3文件)在iPhone/iPad上与Safari一起玩.它绝对与媒体文件无关,因为我在iPhone中使用Apache成功传输它们.

知道为什么会这样吗?

Exception happened during processing of request from ('192.168.1.2', 51775)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
Run Code Online (Sandbox Code Playgroud)

jb.*_*jb. 7

由于sugested使用python替代品,什么是Python的http.server(或SimpleHTTPServer)的更快的替代品?或者完全使用完整的网络服务.快速谷歌建议Mac支持Nignx和Apache2.

  • 感谢您提供[http-server](https://github.com/nodeapps/http-server)的替代方案的链接,但[标记答案](http://stackoverflow.com/a/12905427/2602869) (对于node.js)似乎没有流式传输视频文件.但是,如[另一个答案](http://stackoverflow.com/a/14618010/2602869)中所述,[twistd](http:// http://twistedmatrix.com)(对于Python)做得非常好! (2认同)