         $('#status').text('connected (' + conn.protocol + ')')
         $('#connect').html('Disconnect')
 
+  $('#stop').on 'click', () ->
+      console.log(jQuery('#stop').text())
+      if jQuery('#stop').text() == 'Stop '
+          jQuery('#stop').text('Resume ')
+          jQuery('<span/>', {class: "glyphicon glyphicon-play"}).appendTo('#stop')
+      else if jQuery('#stop').text() == 'Resume '
+          jQuery('#stop').text('Stop ')
+          jQuery('<span/>', {class: "glyphicon glyphicon-stop"}).appendTo('#stop')
 
   $('#connect').on 'click', () ->
       console.log('button connect')

      jQuery('<a/>', {href: "#", text: "None"}).appendTo('#connections>ul>:last-child')
      jQuery('<li/>').appendTo('#connections>ul')
      jQuery('<a/>', {href: "#", text: "Waiting"}).appendTo('#connections>ul>:last-child')

  log = (json_msg) ->
      msg = JSON.parse(json_msg)

          for _conn in msg.conn
              jQuery('<li/>').appendTo('#connections>ul')
              jQuery('<a/>', {href: "#", text: _conn}).appendTo('#connections>ul>:last-child')
          $('#connections>ul').find('>li').on 'click', () ->
                  choice_conn($(this).text())

      else if jQuery('#stop').text() == 'Stop '
          for ii in msg
              jQuery('<li/>', {
                  class: "btn-success",
                  text: ii}).prependTo('#packet_log')


  connect = () ->
