lib/client.js
function Client (options, cb) {
  if (typeof options == 'string')
    options = url.parse(options)
  
  var req;
  if (options.protocol == "https:")
    req = https.request(options);
  else
    req = http.request(options);

  // add the "Icy-MetaData" header
  req.setHeader('Icy-MetaData', '1');

  if ('function' == typeof cb) {
    req.once('icyResponse', cb);
  }

  req.once('response', icyOnResponse);
  req.once('socket', icyOnSocket);

  return req;
}
function Client (options, cb) {
  if (typeof options == 'string')
    options = url.parse(options)
  
  var req;
  if (options.protocol == "https:")
    req = https.request(options);
  else
    req = http.request(options);

  // add the "Icy-MetaData" header
  req.setHeader('Icy-MetaData', '1');

  if ('function' == typeof cb) {
    req.once('icyResponse', cb);
  }

  req.once('response', icyOnResponse);
  req.once('socket', icyOnSocket);

  return req;
}
function Client ( options , cb ) { if ( typeof options == 'string' ) options = url . parse ( options ) var req ; if ( options . protocol == "https:" ) req = https . request ( options ) ; else req = http . request ( options ) ; // add the "Icy-MetaData" header req . setHeader ( 'Icy-MetaData' , '1' ) ; if ( 'function' == typeof cb ) { req . once ( 'icyResponse' , cb ) ; } req . once ( 'response' , icyOnResponse ) ; req . once ( 'socket' , icyOnSocket ) ; return req ; }
The `Client` class is a subclass of the `http.ClientRequest` object.

It adds a stream preprocessor to make "ICY" responses work. This is only needed
because of the strictness of node's HTTP parser. I'll volley for ICY to be
supported (or at least configurable) in the http header for the JavaScript
HTTP rewrite (v0.12 of node?).

The other big difference is that it passes an `icy.Reader` instance
instead of a `http.ClientResponse` instance to the "response" event callback,
so that the "metadata" events are automatically parsed and the raw audio stream
it output without the ICY bytes.

Also see the [`request()`](#request) and [`get()`](#get) convenience functions.

@param {Object} options connection info and options object
@param {Function} cb optional callback function for the "response" event
@api public
The Client class is a subclass of the http . ClientRequest object .