{"id":616,"date":"2014-10-15T10:04:16","date_gmt":"2014-10-15T08:04:16","guid":{"rendered":"https:\/\/www.yelloworb.com\/orbblog\/?p=616"},"modified":"2016-10-30T17:44:28","modified_gmt":"2016-10-30T16:44:28","slug":"debugging-http-communication-over-gsm","status":"publish","type":"post","link":"https:\/\/www.yelloworb.com\/orbblog\/debugging-http-communication-over-gsm\/","title":{"rendered":"Debugging HTTP communication over GSM"},"content":{"rendered":"<p>I&#8217;m writing a HTTP client for the <a href=\"http:\/\/arduino.cc\" title=\"Arduino homepage\" target=\"_blank\">Arduino<\/a>. The debugging options on the <a href=\"http:\/\/arduino.cc\" title=\"Arduino homepage\" target=\"_blank\">Arduino<\/a> are quite limited. And in general doing low level HTTP programming a tool like <a href=\"http:\/\/sockspy.sourceforge.net\/sockspy.html\" title=\"SockSpy homepage\" target=\"_blank\">SockSpy<\/a> is invaluable. Though for traffic to reach <a href=\"http:\/\/sockspy.sourceforge.net\/sockspy.html\" title=\"SockSpy homepage\" target=\"_blank\">SockSpy<\/a> it must be connected to a public TCP IP port. With the common use of firewalls and NATed networks this is generally not the case. How do you solve that?<\/p>\n<p>If you have access to a public server on the internet, SSH is your salvation! Setup a <a href=\"http:\/\/www.alexonlinux.com\/reverse-ssh-tunnel-or-connecting-to-computer-behind-nat-router\" title=\"Reverse SSH tunnel or connecting to computer behind NAT router\" target=\"_blank\">reverse SSH tunnel<\/a> from your server(yelloworb.com in my case, port 3000) to your local machine(port 2000), then configure SockSpy to connect back to the server(if thats the web server you try to talk HTTP with). Like this:<br \/>\n<code class=\"\" data-line=\"\">ssh -R 3000:localhost:2000 yelloworb.com<br \/>\nsockspy 2000 www.server.com 80<br \/>\n<\/code><br \/>\nAnd change your code to talk to your server instead(yelloworb.com and port 3000 in my case).<\/p>\n<p>To get the port forwarding working you need to enable GatewayPorts in the sshd configuration. Read <a href=\"http:\/\/blog.trackets.com\/2014\/05\/17\/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html\">here<\/a> how to do that. The <a href=\"http:\/\/manpages.ubuntu.com\/manpages\/trusty\/man5\/sshd_config.5.html\">SSHd manpages<\/a> has more useful information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m writing a HTTP client for the Arduino. The debugging options on the Arduino are quite limited. And in general doing low level HTTP programming a tool like SockSpy is invaluable. Though for traffic to reach SockSpy it must be connected to a public TCP IP port. With the common use of firewalls and NATed [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[67,28],"tags":[],"class_list":["post-616","post","type-post","status-publish","format-standard","hentry","category-arduino","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/comments?post=616"}],"version-history":[{"count":5,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/616\/revisions"}],"predecessor-version":[{"id":672,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/616\/revisions\/672"}],"wp:attachment":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/media?parent=616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/categories?post=616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/tags?post=616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}