Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Expanding on the comment I left earlier (at the time I could not test): if you have access to Python on your machine, you can create the following simple script - e.g. in a file you call <code>myServer.py</code> (attribution: <a href="http://ilab.cs.byu.edu/python/socket/echoserver.html" rel="nofollow">http://ilab.cs.byu.edu/python/socket/echoserver.html</a> - you will find much more information about Python network programming there; well worth a visit):</p> <pre><code>#!/usr/bin/env python import socket host = '' # your IP address port = 50000 # pick a port you want to listen on. backlog = 5 # number of clients you could handle at once size = 1024 # max size of data packet # create socket: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # connect to host / port: s.bind((host,port)) # start listening: s.listen(backlog) # stay in this loop until ctrl-c is typed at console: while 1: client, address = s.accept() data = client.recv(size) if data: print data # echo data to console client.send(data) # echo data to client (may confuse your application, great for browser) client.close() </code></pre> <p>When I ran this on my Mac by typing</p> <pre><code>chmod 755 myServer.py # make it executable ./myServer # run the script </code></pre> <p>And then went to my browser where I typed</p> <pre><code>http://localhost:50000/?hello=world </code></pre> <p>I got the following in my browser:</p> <pre><code>GET /?hello=world HTTP/1.1 Host: localhost:50000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20100101 Firefox/25.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive </code></pre> <p>And my console looked like this (I hit ctrl-c after servicing the request):</p> <pre><code>[myMac:~myCodePath] myName% ./myServer.py GET /?hello=world HTTP/1.1 Host: localhost:50000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20100101 Firefox/25.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive ^CTraceback (most recent call last): File "./srv.py", line 13, in &lt;module&gt; client, address = s.accept() File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/socket.py", line 202, in accept sock, addr = self._sock.accept() KeyboardInterrupt </code></pre> <p>I think this should be a reasonable way for you to take a look at the traffic from the GPS. It should be easy to see how you can change the response back to the client - right now it's just the request being echoed, but you can obviously send anything with</p> <pre><code>client.send('anything') </code></pre> <p>Let me know if you have any further questions about this. Note I used port <code>50000</code> - I was guessing it would be available. The way my machine was set up I could not use port 80 (the default html port) but that's mostly a question of firewall configuration etc.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload