title: Open socket connection with Icecast server on iOS
body: <p>I am trying to create a source client for an Icecast server on iOS.</p>
  
  <p>I believe I understand the protocol here <a href="https://stackoverflow.com/questions/5215019/icecast-2-protocol-description-streaming-to-it-using-c-sharp/9985297#9985297">Icecast 2: protocol description, streaming to it using C#</a></p>
  
  <p>However, I am having trouble creating the socket connection to the server. Say the server is running on port 8000 at <a href="http://myicecastserver.com" rel="nofollow noreferrer">http://myicecastserver.com</a>. I setup a mountpoint called stream which works when ezstream is used as input. How should I open the connection from iOS?</p>
  
  <p>I have used the AsyncSocket library like this:</p>
  
  <pre><code>[socket connectToHost:@"http://myicecastserver.com" onPort:8000 error:&amp;err];
  </code></pre>
  
  <p>like this:</p>
  
  <pre><code>[socket connectToHost:@"http://myicecastserver.com/stream" onPort:8000 error:&amp;err];
  </code></pre>
  
  <p>to no avail.</p>
  
  <p>I also tried using a websocket connection with SocketRocket also to no avail:</p>
  
  <pre><code>SRWebSocket *socket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:@"http://myicecastserver.com:8000/stream"]];
  [socket setDelegate:self];
  [socket open];
  </code></pre>
  
  <p>this gives me a 404 error</p>
  
  <p>I have tried a few variations on this but just cannot open this connection to save my life!
  Thanks!</p>
  
  <p>UPDATE</p>
  
  <p>I am using SocketTest as a test source client and am able to connect to <a href="http://myicecastserver.com" rel="nofollow noreferrer">http://myicecastserver.com</a> on port 8000</p>