

Ask HN: upd to http - jo

Google usually helps me find these types of questions, but nothing is turning up.  So I thought I'd throw this question out.<p>I need to get a UDP packet to HTTP (on my shared webhost)  UPD because a small microcontroller (low cost sensor) generates the packet.  To HTTP because my webhost doesn't allow socket connections beside port 80.<p>I'm using a home server right now to catch the UDP packet and then pass along the data to the webhost over HTTP.   But can't use that long term.. Any web service available for this, or some tips?<p>Trying to keep things cheap and simple for this side project.
======
gojomo
A shared hosting account might let you run a UDP listening process; a virtual
host definitely would.

Really, anyplace you have a shell account can probably serve the same role as
your home server.

~~~
jo
thanks you. I didn't think any shared hosts would allow UDP listening, I'll
look around for that.

~~~
gojomo
I haven't read the fine print to see if it's allowed by their terms of
service, but I just tried setting up a simple UDP-to-HTTP relay on Dreamhost:

    
    
      % nc -u -l -p 59595 | xargs -I UDP curl http://example.com/path?u=UDP
    

...and it worked just fine. I would think as long as the traffic is a tiny
fraction of what web traffic would be -- and occasional UDP packets fit that
bill -- they might either officially allow it or just not mind.

~~~
jo
Great, thanks. And thanks for the cli paste - I had not heard of 'nc'.

