luking-dev / webiopi

Automatically exported from code.google.com/p/webiopi
0 stars 0 forks source link

enable CORS support or JSONP support for REST API #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an ajax request to the http rest api, using another server even 
locally with different port
2. initiate the requset, and you will get CORS error
3.
...

WebIOPi version used?
=>

Python version used?
=>

Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>

Raspberry Pi board revision? (1 or 2)
=> 1

For Javascript side bugs, Browser?
=>

Please provide any additional information below.

Need to enable CORS headers on python server side, or allow jsonp return of 
data. I am attempting to communicate to the raspberry pi's GPIO via REST but 
since my nodeJs http server is running on port 80 and the webiopi is running on 
port 8000 it causes a CORS issue. JSONP wont work as data is transmitted as 
text/plain and callback is dropped.

Original issue reported on code.google.com by m.dev...@gmail.com on 30 Mar 2013 at 8:45

GoogleCodeExporter commented 9 years ago
refused for security issue.
you should proxy requests from your front server to webiopi instead.

Original comment by tro...@trouch.com on 30 Mar 2013 at 7:24

GoogleCodeExporter commented 9 years ago
Can you provide any documentation on how to do this?

Original comment by m.dev...@gmail.com on 1 Apr 2013 at 4:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I don't know how to do it using nodejs. sorry.
for apache, you have to use proxypass directive.

Original comment by tro...@trouch.com on 1 Apr 2013 at 4:28

GoogleCodeExporter commented 9 years ago
Issue 50 has been merged into this issue.

Original comment by tro...@trouch.com on 16 May 2013 at 9:42