title: Working with webinpectord
body: <p>I just want to communicate with Mobile Safari using 'webinpectord' (hobby project). My aim is to just display an alert 'hi' on Mobile Safari. I know I can do this using Safari's debugging console. At the moment what things I know is Mobile Safari ('webinpectord') listen to port 27753 on localhost using IPV6 protocol. And from <a href="https://github.com/leftlogic/remote-debug/blob/master/safari/sequence.md" rel="nofollow noreferrer">this</a> page I understand the sequense of communication with Mobile Safari. I perused already working programs like <a href="https://github.com/leftlogic/remote-debug" rel="nofollow noreferrer">remote-debug</a>, <a href="https://github.com/andydavies/node-iosdriver/" rel="nofollow noreferrer">node-iosdriver</a> and <a href="https://github.com/google/ios-webkit-debug-proxy" rel="nofollow noreferrer">iOS-webkitproxy</a>. Then I tried to write a program in C which connects to localhost:27753 and then send and receive commands. My problem is I can connect and send commands to port 27753 but not getting any response from that port. </p>
  
  <p>I tried to send </p>
  
  <pre><code>{ __argument: { WIRConnectionIdentifierKey: '17858421-36EF-4752-89F7-7A13ED5782C5' },
     __selector: '_rpc_reportIdentifier:' }
  </code></pre>
  
  <p>According to <a href="https://github.com/leftlogic/remote-debug/blob/master/safari/sequence.md" rel="nofollow noreferrer">this</a> article, Mobile Safari has to send back response like</p>
  
  <pre><code>{ __selector: '_rpc_reportSetup:',
   __argument: 
     { WIRSimulatorNameKey: 'iPhone Simulator',
       WIRSimulatorBuildKey: '10A403' } }
  
  
  { __selector: '_rpc_reportConnectedApplicationList:',
   __argument: 
       { WIRApplicationDictionaryKey: 
          { 'com.apple.mobilesafari': 
             { WIRApplicationIdentifierKey: 'com.apple.mobilesafari',
                WIRApplicationNameKey: 'Safari',
                WIRIsApplicationProxyKey: false } } } }
  </code></pre>
  
  <p>but I am not getting any response from Mobile Safari. I just can send commands to there. </p>
  
  <p>Let us assume that my program is buggy !</p>
  
  <p>So I tried to experiment with 'telnet'. Here also I can connect to localhost:27753 and I can send commands and not getting any response. I am attaching screen shot. </p>
  
  <p><img src="https://i.stack.imgur.com/VmHeY.png" alt="Sending Connection Identifier Key">
  <img src="https://i.stack.imgur.com/8lhAx.png" alt="enter image description here"></p>
  
  <p>You can see that I tried many combinations like </p>
  
  <pre><code>  { "__argument": { "WIRConnectionIdentifierKey": "17858421-36EF-4752-89F7-7A13ED5782C5" }, "__selector": "_rpc_reportIdentifier: " }
  
  
    {\"__argument\": { \"WIRConnectionIdentifierKey\": \"17858421-36EF-4752-89F7-7A13ED5782C5\" }, \"__selector\": \"_rpc_reportIdentifier: \"}
  
  
    "{ "__argument": { "WIRConnectionIdentifierKey": "17858421-36EF-4752-89F7-7A13ED5782C5" }, "__selector": "_rpc_reportIdentifier: " }"
  </code></pre>
  
  <p>but nothing worked.</p>
  
  <p>Lastly I tried curl to send data. That also failed !</p>
  
  <p><img src="https://i.stack.imgur.com/GGwJp.png" alt="enter image description here"></p>
  
  <p><strong>Can anybody tell me what should I do to get response like</strong></p>
  
  <pre><code>  { __selector: '_rpc_reportSetup:',
   __argument: 
     { WIRSimulatorNameKey: 'iPhone Simulator',
       WIRSimulatorBuildKey: '10A403' } }
  
  
  { __selector: '_rpc_reportConnectedApplicationList:',
   __argument: 
       { WIRApplicationDictionaryKey: 
          { 'com.apple.mobilesafari': 
             { WIRApplicationIdentifierKey: 'com.apple.mobilesafari',
                WIRApplicationNameKey: 'Safari',
                WIRIsApplicationProxyKey: false } } } }
  </code></pre>
  
  <p><strong>when sending request</strong></p>
  
  <pre><code>  { __argument: { WIRConnectionIdentifierKey: '17858421-36EF-4752-89F7-7A13ED5782C5' },
     __selector: '_rpc_reportIdentifier:' }
  </code></pre>
  
  <p><strong>to localhost:27753 using 'telnet' or 'curl'.</strong></p>
  
  <p>I tried two days in different ways (wrote C program, python program and lastly tried telnet and curl) and did not get succeeded. So please help !</p>