Tag: icecast

在iOS上与Icecast服务器打开套接字连接

我正在尝试为iOS上的Icecast服务器创build源客户端。 我相信我理解这里的协议Icecast 2:协议描述,使用C# 但是,我无法创build到服务器的套接字连接。 假设服务器在http://myicecastserver.com上的8000端口上运行。 我设置了一个名为stream的安装点,它在ezstream用作input时起作用。 我应该如何从iOS打开连接? 我已经使用这样的AsyncSocket库: [socket connectToHost:@"http://myicecastserver.com" onPort:8000 error:&err]; 喜欢这个: [socket connectToHost:@"http://myicecastserver.com/stream" onPort:8000 error:&err]; 无济于事。 我也尝试使用与SocketRocket的websocket连接也无济于事: SRWebSocket *socket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:@"http://myicecastserver.com:8000/stream"]]; [socket setDelegate:self]; [socket open]; 这给了我一个404错误 我已经尝试了一些这方面的变化,但只是无法打开这个连接来挽救我的生命! 谢谢! UPDATE 我使用SocketTest作为testing源客户端,并且能够在端口8000上连接到http://myicecastserver.com

IceCast与iPhone头问题

我正在尝试使用Icecast服务器与我的iPhone应用程序。 我正在为我的icecast服务器创build一个源客户端。 目前我正在使用NSURL级别发送请求来创build一个挂载点到服务器。 但是,我觉得这还不够。 我必须使用任何其他核心库,如CFNetworks或BSD套接字。 但我不确定。 任何人都可以帮我一下,哪个库适合iPhone实现icecast。 第二件事是当我为Icecast请求创build挂载点时, 我使用以下链接 – Icecast 2:协议描述,使用C# 但是由于没有密钥,我无法发送SOURCE /mountpoint ICE/1.0 。 我发送像 – NSMutableString *requestString = [NSMutableString stringWithFormat:@"http://192.168.1.99:8000"]; NSLog(@"Request String = %@", requestString); NSURL *url = [NSURL URLWithString:requestString]; NSMutableURLRequest *requestURL = [NSMutableURLRequest requestWithURL:url]; [requestURL setHTTPMethod:@"GET"]; [requestURL addValue:@"SOURCE /mp3test ICE/1.0" forHTTPHeaderField:@"SOURCE"]; [requestURL addValue:@"audio/mpeg" forHTTPHeaderField: @"Content-Type"]; [requestURL setValue:@"Basic c291cmNlOmhhY2ttZQ==" forHTTPHeaderField:@"Authorization"]; [requestURL setValue:@"This […]

为iOS投冰源客户端

我一直在试图为ios创build一个用于投冰的源代码客户端。 我已经能够连接使用asyncsocket连接到套接字。 我也能够写入数据到服务器。 icecastconfiguration是为mp3格式完成的。 但写入服务器的MP3文件已损坏。 我正在提供一些代码片段。 标题: NSString *string = @"SOURCE /sync HTTP/1.0\r\n" "Authorization: Basic c291cmNlOmhhY2ttZQ==\r\n" "User-Agent: butt-0.1.12\r\n" "User-Agent: butt-0.1.12\r\n" "content-type: audio/mpeg\r\n" "ice-name: sync's Stream\r\n" "ice-public: 0\r\n" "ice-genre: Rock\r\n" "ice-description: This is my server description\r\n" "Connection: keep-alive\r\n" "ice-audio-info: ice-samplerate=44100;ice-bitrate=48;ice-channels=2\r\n\r\n"; NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; //sending http request to write the header NSLog(@"Sending HTTP Request."); [socket […]