You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com> on 2013/06/06 19:23:53 UTC

Using Wookie proxy behind rave

Hello,

I'm using wookie to deploy my widgets to rave. I've found something that 
I don't know how handle.

When developing in wookie you have a proxy that is managed by policies 
and it allows you to via javascript make queries to domains that are 
outside the server.

While this works out of the box, when you deploy the widget to rave it 
does not work. Chromiun says something like:

Unsafe JavaScript attempt to access frame with URL 
http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from 
frame with URL 
http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 
<http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. 
Domains, protocols and ports must match.


This is because wookie is running on port 8180 and Rave is running in 
port 8080. When making a call to the wookie proxy it fails.

How should I work around this problem. I suppose that Rave must have 
it's own proxy or run everything on same port. But I don't want to run 
everything on the same container, and maybe not even same machine.

What do you think?

Thank you in advance.


Re: Using Wookie proxy behind rave

Posted by Erin Noe-Payne <er...@gmail.com>.
On Fri, Jun 7, 2013 at 5:03 AM, Gonzalo Aguilar Delgado
<ga...@aguilardelgado.com> wrote:
> Hi Scott,
>
> I can say that the widget is rendered into a IFrame as you said. I tested
> other widgets and they also fail with chrome. Maybe it has something to do
> with Chrome not with Wookie or Rave.
>
> Everything works perfect with Firefox.

Do you have the latest version of Firefox? Earlier versions were more
lax in enforcing port number in SOP.

>
> Have to do some other tests...
>
>
> El 07/06/13 10:29, Scott Wilson escribió:
>
>> On 6 Jun 2013, at 21:00, Erin Noe-Payne wrote:
>>
>>> The widgets are iframes. Open the inspector in chrome or firefox and
>>> you should be able to identify the iframe elements and the url from
>>> which they are hosted:
>>>
>>> <iframe src="...">
>>>
>>> The error you are seeing is because the widgets are violating the
>>> same-origin policy, making a request to a different origin from where
>>> they are hosted. If that iframe src url is a different origin from the
>>> wookie proxy server then it will cause that error.
>>>
>>> In a default deployment rave hosts the gadgets, wookie, and shindig
>>> all from the same origin. If you want to host wookie from a different
>>> origin and you want to make a request from a gadget then I believe you
>>> need to host that gadgets from that same origin.
>>
>> I'm not sure Erin.
>>
>> Normally the widget would call /proxy?url=actual_url within its own origin
>> (on port 8180). So there isn't a requirement AFAIK that both Rave and Wookie
>> have to be on the same port, at least for this purpose.
>>

Correct, rave and wookie do not need to be hosted on the same origin.
But the iframe url needs to match the origin of the proxy server,
which I believe means the wookie gadgets need to be hosted from that
origin. I'm definitely not 100% though.

>> if Wookie is running on 8180, and so is its proxy server, then I don't
>> understand why it would be trying to connect with Rave on 8080.
>>
>> I wonder if this problem has nothing to do with proxied access? Do other
>> widgets also generate the same error without invoking a proxied URL?
>>
>>> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
>>> <sc...@gmail.com> wrote:
>>>>
>>>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>>>>
>>>>> Hello Scott,
>>>>>
>>>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on
>>>>> Firefox.
>>>>>
>>>>> It seems that Chromiun has something stricter. I don't know if this a
>>>>> special setting or not.
>>>>>
>>>>> Anyway I'm implementing a proxy based on Wookie one just in case it's
>>>>> not an IFrame.
>>>>>
>>>>> I cannot tell much about how it's rendered but it's rave default. It
>>>>> seems to be an IFrame to me since the code for the widget does not shows in
>>>>> the source view of the page.
>>>>>
>>>>> Mmmmm. That's curious.
>>>>>
>>>>> Someone should investigate what's happening with Chromium. I will try
>>>>> later.
>>>>
>>>> Its odd given that the widget appears to be in:
>>>>
>>>>
>>>>>>> http://localhost:8180/wookie/
>>>>
>>>> With a proxy at:
>>>>
>>>>>>> &proxy=http://localhost:8180/wookie/
>>>>
>>>> And yet we have this attempt to access:
>>>>
>>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>>>>
>>>> Which I presume isn't the proxied URL you're after?
>>>>
>>>> Something doesn't add up here...
>>>>
>>>>>
>>>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>>>>
>>>>>> Hi Gonzalo,
>>>>>>
>>>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm using wookie to deploy my widgets to rave. I've found something
>>>>>>> that I don't know how handle.
>>>>>>>
>>>>>>> When developing in wookie you have a proxy that is managed by
>>>>>>> policies and it allows you to via javascript make queries to domains that
>>>>>>> are outside the server.
>>>>>>>
>>>>>>> While this works out of the box, when you deploy the widget to rave
>>>>>>> it does not work. Chromiun says something like:
>>>>>>>
>>>>>>> Unsafe JavaScript attempt to access frame with URL
>>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame
>>>>>>> with URL
>>>>>>> http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080
>>>>>>> <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>.
>>>>>>> Domains, protocols and ports must match.
>>>>>>>
>>>>>>>
>>>>>>> This is because wookie is running on port 8180 and Rave is running in
>>>>>>> port 8080. When making a call to the wookie proxy it fails.
>>>>>>>
>>>>>>> How should I work around this problem. I suppose that Rave must have
>>>>>>> it's own proxy or run everything on same port. But I don't want to run
>>>>>>> everything on the same container, and maybe not even same machine.
>>>>>>>
>>>>>>> What do you think?
>>>>>>
>>>>>> The W3C Widgets are normally rendered within iFrames so a call to the
>>>>>> proxy server would be to the same origin, so I'm not sure what is happening
>>>>>> here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>>>>
>>>>>>> Thank you in advance.
>>>>>>>
>>>>>> S
>
>

Re: Using Wookie proxy behind rave

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hi Scott,

I can say that the widget is rendered into a IFrame as you said. I 
tested other widgets and they also fail with chrome. Maybe it has 
something to do with Chrome not with Wookie or Rave.

Everything works perfect with Firefox.

Have to do some other tests...


El 07/06/13 10:29, Scott Wilson escribió:
> On 6 Jun 2013, at 21:00, Erin Noe-Payne wrote:
>
>> The widgets are iframes. Open the inspector in chrome or firefox and
>> you should be able to identify the iframe elements and the url from
>> which they are hosted:
>>
>> <iframe src="...">
>>
>> The error you are seeing is because the widgets are violating the
>> same-origin policy, making a request to a different origin from where
>> they are hosted. If that iframe src url is a different origin from the
>> wookie proxy server then it will cause that error.
>>
>> In a default deployment rave hosts the gadgets, wookie, and shindig
>> all from the same origin. If you want to host wookie from a different
>> origin and you want to make a request from a gadget then I believe you
>> need to host that gadgets from that same origin.
> I'm not sure Erin.
>
> Normally the widget would call /proxy?url=actual_url within its own origin (on port 8180). So there isn't a requirement AFAIK that both Rave and Wookie have to be on the same port, at least for this purpose.
>
> if Wookie is running on 8180, and so is its proxy server, then I don't understand why it would be trying to connect with Rave on 8080.
>
> I wonder if this problem has nothing to do with proxied access? Do other widgets also generate the same error without invoking a proxied URL?
>
>> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
>> <sc...@gmail.com> wrote:
>>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>>>
>>>> Hello Scott,
>>>>
>>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
>>>>
>>>> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
>>>>
>>>> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
>>>>
>>>> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
>>>>
>>>> Mmmmm. That's curious.
>>>>
>>>> Someone should investigate what's happening with Chromium. I will try later.
>>> Its odd given that the widget appears to be in:
>>>
>>>
>>>>>> http://localhost:8180/wookie/
>>> With a proxy at:
>>>
>>>>>> &proxy=http://localhost:8180/wookie/
>>> And yet we have this attempt to access:
>>>
>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>>> Which I presume isn't the proxied URL you're after?
>>>
>>> Something doesn't add up here...
>>>
>>>>
>>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>>> Hi Gonzalo,
>>>>>
>>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>>>>>
>>>>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>>>>>
>>>>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>>>>>
>>>>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>>>>>
>>>>>>
>>>>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>>>>>
>>>>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>>>>>
>>>>>> What do you think?
>>>>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>>>
>>>>>> Thank you in advance.
>>>>>>
>>>>> S


Re: Using Wookie proxy behind rave

Posted by Scott Wilson <sc...@gmail.com>.
On 6 Jun 2013, at 21:00, Erin Noe-Payne wrote:

> The widgets are iframes. Open the inspector in chrome or firefox and
> you should be able to identify the iframe elements and the url from
> which they are hosted:
> 
> <iframe src="...">
> 
> The error you are seeing is because the widgets are violating the
> same-origin policy, making a request to a different origin from where
> they are hosted. If that iframe src url is a different origin from the
> wookie proxy server then it will cause that error.
> 
> In a default deployment rave hosts the gadgets, wookie, and shindig
> all from the same origin. If you want to host wookie from a different
> origin and you want to make a request from a gadget then I believe you
> need to host that gadgets from that same origin.

I'm not sure Erin.

Normally the widget would call /proxy?url=actual_url within its own origin (on port 8180). So there isn't a requirement AFAIK that both Rave and Wookie have to be on the same port, at least for this purpose.

if Wookie is running on 8180, and so is its proxy server, then I don't understand why it would be trying to connect with Rave on 8080. 

I wonder if this problem has nothing to do with proxied access? Do other widgets also generate the same error without invoking a proxied URL?

> 
> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
> <sc...@gmail.com> wrote:
>> 
>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>> 
>>> Hello Scott,
>>> 
>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
>>> 
>>> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
>>> 
>>> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
>>> 
>>> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
>>> 
>>> Mmmmm. That's curious.
>>> 
>>> Someone should investigate what's happening with Chromium. I will try later.
>> 
>> Its odd given that the widget appears to be in:
>> 
>> 
>>>>> http://localhost:8180/wookie/
>> 
>> With a proxy at:
>> 
>>>>> &proxy=http://localhost:8180/wookie/
>> 
>> And yet we have this attempt to access:
>> 
>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>> 
>> Which I presume isn't the proxied URL you're after?
>> 
>> Something doesn't add up here...
>> 
>>> 
>>> 
>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>> Hi Gonzalo,
>>>> 
>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>> 
>>>>> Hello,
>>>>> 
>>>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>>>> 
>>>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>>>> 
>>>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>>>> 
>>>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>>>> 
>>>>> 
>>>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>>>> 
>>>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>>>> 
>>>>> What do you think?
>>>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>> 
>>>>> Thank you in advance.
>>>>> 
>>>> S
>>> 
>> 


Re: Using Wookie proxy behind rave

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
I will take a look to this. Thank you for trying. I will check my 
version of chromium.


El 07/06/13 20:13, Scott Wilson escribió:
> Hi Gonzalo,
>
> I've had a go at replicating the problem.
>
> I set up Rave (trunk) running on port 8080.
> I set up Wookie (trunk) running on port 8100.
> I' changed portal.properties in Rave to point to port 8100 for Wookie.
> I added a W3C Widget that uses the proxy service (Weather.wgt)  to 
> Rave  and added it to my workspace.
>
> The Weather Widget renders from port 8100 OK on Safari, Firefox and 
> Chrome (Version 27.0.1453.110), accessing x-origin data using the 
> proxy, e.g.:
>
> http://localhost:8100/wookie/proxy?instanceid_key=xlspngx6TKOnHVLa1c426V4KSsA.eq.&url=http://newsrss.bbc.co.uk/weather/forecast/9/Next3DaysRSS.xml
>
> So possibly the problem lies elsewhere - hope this helps.
>
> S
>
>
>
>
> On 7 Jun 2013, at 17:30, Gonzalo Aguilar Delgado wrote:
>
>> Hi Erin,
>>
>> Didn't see this message.
>>
>>
>> El 06/06/13 22:00, Erin Noe-Payne escribió:
>>> The widgets are iframes. Open the inspector in chrome or firefox and
>>> you should be able to identify the iframe elements and the url from
>>> which they are hosted:
>>>
>>> <iframe src="...">
>>>
>>> The error you are seeing is because the widgets are violating the
>>> same-origin policy, making a request to a different origin from where
>>> they are hosted. If that iframe src url is a different origin from the
>>> wookie proxy server then it will cause that error.
>> But in this case it's not. It uses the wookie proxy server to make a 
>> request to another host. But gadget and wookie are in the same 
>> server. Wookie is serving the gadget. It's data what comes from 
>> another server and that's why we use the proxy inside wookie.
>>
>> This works perfectly in wookie demo.
>>
>>> In a default deployment rave hosts the gadgets, wookie, and shindig
>>> all from the same origin. If you want to host wookie from a different
>>> origin and you want to make a request from a gadget then I believe you
>>> need to host that gadgets from that same origin.
>> Yes! But I think Rave is one thing and the rest is another. I want 
>> everything in the right place. This way we can escalate our 
>> architecture. Since Rave will show different widgets from different 
>> servers in the future.
>>
>>>
>>> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
>>> <scott.bradley.wilson@gmail.com 
>>> <ma...@gmail.com>> wrote:
>>>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>>>>
>>>>> Hello Scott,
>>>>>
>>>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly 
>>>>> on Firefox.
>>>>>
>>>>> It seems that Chromiun has something stricter. I don't know if 
>>>>> this a special setting or not.
>>>>>
>>>>> Anyway I'm implementing a proxy based on Wookie one just in case 
>>>>> it's not an IFrame.
>>>>>
>>>>> I cannot tell much about how it's rendered but it's rave default. 
>>>>> It seems to be an IFrame to me since the code for the widget does 
>>>>> not shows in the source view of the page.
>>>>>
>>>>> Mmmmm. That's curious.
>>>>>
>>>>> Someone should investigate what's happening with Chromium. I will 
>>>>> try later.
>>>> Its odd given that the widget appears to be in:
>>>>
>>>>
>>>>>>> http://localhost:8180/wookie/
>>>> With a proxy at:
>>>>
>>>>>>> &proxy=http://localhost:8180/wookie/
>>>> And yet we have this attempt to access:
>>>>
>>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>>>> Which I presume isn't the proxied URL you're after?
>>>>
>>>> Something doesn't add up here...
>>>>
>>>>>
>>>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>>>> Hi Gonzalo,
>>>>>>
>>>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm using wookie to deploy my widgets to rave. I've found 
>>>>>>> something that I don't know how handle.
>>>>>>>
>>>>>>> When developing in wookie you have a proxy that is managed by 
>>>>>>> policies and it allows you to via javascript make queries to 
>>>>>>> domains that are outside the server.
>>>>>>>
>>>>>>> While this works out of the box, when you deploy the widget to 
>>>>>>> rave it does not work. Chromiun says something like:
>>>>>>>
>>>>>>> Unsafe JavaScript attempt to access frame with URL 
>>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 
>>>>>>> from frame with URL 
>>>>>>> http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 
>>>>>>> <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. 
>>>>>>> Domains, protocols and ports must match.
>>>>>>>
>>>>>>>
>>>>>>> This is because wookie is running on port 8180 and Rave is 
>>>>>>> running in port 8080. When making a call to the wookie proxy it 
>>>>>>> fails.
>>>>>>>
>>>>>>> How should I work around this problem. I suppose that Rave must 
>>>>>>> have it's own proxy or run everything on same port. But I don't 
>>>>>>> want to run everything on the same container, and maybe not even 
>>>>>>> same machine.
>>>>>>>
>>>>>>> What do you think?
>>>>>> The W3C Widgets are normally rendered within iFrames so a call to 
>>>>>> the proxy server would be to the same origin, so I'm not sure 
>>>>>> what is happening here. Are the widgets in IFrames, or rendered 
>>>>>> inline somehow within Rave?
>>>>>>
>>>>>>> Thank you in advance.
>>>>>>>
>>>>>> S
>>
>


Re: Using Wookie proxy behind rave

Posted by Scott Wilson <sc...@gmail.com>.
Hi Gonzalo, 

I've had a go at replicating the problem.

I set up Rave (trunk) running on port 8080.
I set up Wookie (trunk) running on port 8100.
I' changed portal.properties in Rave to point to port 8100 for Wookie.
I added a W3C Widget that uses the proxy service (Weather.wgt)  to Rave  and added it to my workspace.

The Weather Widget renders from port 8100 OK on Safari, Firefox and Chrome (Version 27.0.1453.110), accessing x-origin data using the proxy, e.g.: 

http://localhost:8100/wookie/proxy?instanceid_key=xlspngx6TKOnHVLa1c426V4KSsA.eq.&url=http://newsrss.bbc.co.uk/weather/forecast/9/Next3DaysRSS.xml

So possibly the problem lies elsewhere - hope this helps.

S




On 7 Jun 2013, at 17:30, Gonzalo Aguilar Delgado wrote:

> Hi Erin,
> 
> Didn't see this message.
> 
> 
> El 06/06/13 22:00, Erin Noe-Payne escribió:
>> The widgets are iframes. Open the inspector in chrome or firefox and
>> you should be able to identify the iframe elements and the url from
>> which they are hosted:
>> 
>> <iframe src="...">
>> 
>> The error you are seeing is because the widgets are violating the
>> same-origin policy, making a request to a different origin from where
>> they are hosted. If that iframe src url is a different origin from the
>> wookie proxy server then it will cause that error.
> But in this case it's not. It uses the wookie proxy server to make a request to another host. But gadget and wookie are in the same server. Wookie is serving the gadget. It's data what comes from another server and that's why we use the proxy inside wookie.
> 
> This works perfectly in wookie demo.
> 
>> In a default deployment rave hosts the gadgets, wookie, and shindig
>> all from the same origin. If you want to host wookie from a different
>> origin and you want to make a request from a gadget then I believe you
>> need to host that gadgets from that same origin.
> Yes! But I think Rave is one thing and the rest is another. I want everything in the right place. This way we can escalate our architecture. Since Rave will show different widgets from different servers in the future.
> 
>> 
>> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
>> <sc...@gmail.com> wrote:
>>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>>> 
>>>> Hello Scott,
>>>> 
>>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
>>>> 
>>>> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
>>>> 
>>>> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
>>>> 
>>>> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
>>>> 
>>>> Mmmmm. That's curious.
>>>> 
>>>> Someone should investigate what's happening with Chromium. I will try later.
>>> Its odd given that the widget appears to be in:
>>> 
>>> 
>>>>>> http://localhost:8180/wookie/
>>> With a proxy at:
>>> 
>>>>>> &proxy=http://localhost:8180/wookie/
>>> And yet we have this attempt to access:
>>> 
>>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>>> Which I presume isn't the proxied URL you're after?
>>> 
>>> Something doesn't add up here...
>>> 
>>>> 
>>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>>> Hi Gonzalo,
>>>>> 
>>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>>> 
>>>>>> Hello,
>>>>>> 
>>>>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>>>>> 
>>>>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>>>>> 
>>>>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>>>>> 
>>>>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>>>>> 
>>>>>> 
>>>>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>>>>> 
>>>>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>>>>> 
>>>>>> What do you think?
>>>>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>>> 
>>>>>> Thank you in advance.
>>>>>> 
>>>>> S
> 


Re: Using Wookie proxy behind rave

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hi Erin,

Didn't see this message.


El 06/06/13 22:00, Erin Noe-Payne escribió:
> The widgets are iframes. Open the inspector in chrome or firefox and
> you should be able to identify the iframe elements and the url from
> which they are hosted:
>
> <iframe src="...">
>
> The error you are seeing is because the widgets are violating the
> same-origin policy, making a request to a different origin from where
> they are hosted. If that iframe src url is a different origin from the
> wookie proxy server then it will cause that error.
But in this case it's not. It uses the wookie proxy server to make a 
request to another host. But gadget and wookie are in the same server. 
Wookie is serving the gadget. It's data what comes from another server 
and that's why we use the proxy inside wookie.

This works perfectly in wookie demo.

> In a default deployment rave hosts the gadgets, wookie, and shindig
> all from the same origin. If you want to host wookie from a different
> origin and you want to make a request from a gadget then I believe you
> need to host that gadgets from that same origin.
Yes! But I think Rave is one thing and the rest is another. I want 
everything in the right place. This way we can escalate our 
architecture. Since Rave will show different widgets from different 
servers in the future.

>
> On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
> <sc...@gmail.com> wrote:
>> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>>
>>> Hello Scott,
>>>
>>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
>>>
>>> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
>>>
>>> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
>>>
>>> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
>>>
>>> Mmmmm. That's curious.
>>>
>>> Someone should investigate what's happening with Chromium. I will try later.
>> Its odd given that the widget appears to be in:
>>
>>
>>>>> http://localhost:8180/wookie/
>> With a proxy at:
>>
>>>>> &proxy=http://localhost:8180/wookie/
>> And yet we have this attempt to access:
>>
>>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>> Which I presume isn't the proxied URL you're after?
>>
>> Something doesn't add up here...
>>
>>>
>>> El 06/06/13 20:23, Scott Wilson escribió:
>>>> Hi Gonzalo,
>>>>
>>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>>>>
>>>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>>>>
>>>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>>>>
>>>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>>>>
>>>>>
>>>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>>>>
>>>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>>>>
>>>>> What do you think?
>>>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>>
>>>>> Thank you in advance.
>>>>>
>>>> S


Re: Using Wookie proxy behind rave

Posted by Erin Noe-Payne <er...@gmail.com>.
The widgets are iframes. Open the inspector in chrome or firefox and
you should be able to identify the iframe elements and the url from
which they are hosted:

<iframe src="...">

The error you are seeing is because the widgets are violating the
same-origin policy, making a request to a different origin from where
they are hosted. If that iframe src url is a different origin from the
wookie proxy server then it will cause that error.

In a default deployment rave hosts the gadgets, wookie, and shindig
all from the same origin. If you want to host wookie from a different
origin and you want to make a request from a gadget then I believe you
need to host that gadgets from that same origin.

On Thu, Jun 6, 2013 at 2:58 PM, Scott Wilson
<sc...@gmail.com> wrote:
>
> On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:
>
>> Hello Scott,
>>
>> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
>>
>> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
>>
>> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
>>
>> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
>>
>> Mmmmm. That's curious.
>>
>> Someone should investigate what's happening with Chromium. I will try later.
>
> Its odd given that the widget appears to be in:
>
>
>>>> http://localhost:8180/wookie/
>
> With a proxy at:
>
>>>> &proxy=http://localhost:8180/wookie/
>
> And yet we have this attempt to access:
>
>>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5
>
> Which I presume isn't the proxied URL you're after?
>
> Something doesn't add up here...
>
>>
>>
>> El 06/06/13 20:23, Scott Wilson escribió:
>>> Hi Gonzalo,
>>>
>>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>>>
>>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>>>
>>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>>>
>>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>>>
>>>>
>>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>>>
>>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>>>
>>>> What do you think?
>>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>>>
>>>> Thank you in advance.
>>>>
>>> S
>>
>

Re: Using Wookie proxy behind rave

Posted by Scott Wilson <sc...@gmail.com>.
On 6 Jun 2013, at 19:31, Gonzalo Aguilar Delgado wrote:

> Hello Scott,
> 
> Mmmmm. My eyes grew a lot when I've seen that it works perfectly on Firefox.
> 
> It seems that Chromiun has something stricter. I don't know if this a special setting or not.
> 
> Anyway I'm implementing a proxy based on Wookie one just in case it's not an IFrame.
> 
> I cannot tell much about how it's rendered but it's rave default. It seems to be an IFrame to me since the code for the widget does not shows in the source view of the page.
> 
> Mmmmm. That's curious.
> 
> Someone should investigate what's happening with Chromium. I will try later.

Its odd given that the widget appears to be in:


>>> http://localhost:8180/wookie/

With a proxy at:

>>> &proxy=http://localhost:8180/wookie/

And yet we have this attempt to access:

>>> http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 

Which I presume isn't the proxied URL you're after?

Something doesn't add up here...

> 
> 
> El 06/06/13 20:23, Scott Wilson escribió:
>> Hi Gonzalo,
>> 
>> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>> 
>>> Hello,
>>> 
>>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>> 
>>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>> 
>>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>> 
>>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>> 
>>> 
>>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>> 
>>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>> 
>>> What do you think?
>> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>> 
>>> Thank you in advance.
>>> 
>> S
> 


Re: Using Wookie proxy behind rave

Posted by Gonzalo Aguilar Delgado <ga...@aguilardelgado.com>.
Hello Scott,

Mmmmm. My eyes grew a lot when I've seen that it works perfectly on 
Firefox.

It seems that Chromiun has something stricter. I don't know if this a 
special setting or not.

Anyway I'm implementing a proxy based on Wookie one just in case it's 
not an IFrame.

I cannot tell much about how it's rendered but it's rave default. It 
seems to be an IFrame to me since the code for the widget does not shows 
in the source view of the page.

Mmmmm. That's curious.

Someone should investigate what's happening with Chromium. I will try later.


El 06/06/13 20:23, Scott Wilson escribió:
> Hi Gonzalo,
>
> On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:
>
>> Hello,
>>
>> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
>>
>> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
>>
>> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
>>
>> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
>>
>>
>> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
>>
>> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
>>
>> What do you think?
> The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?
>
>> Thank you in advance.
>>
> S


Re: Using Wookie proxy behind rave

Posted by Scott Wilson <sc...@gmail.com>.
Hi Gonzalo,

On 6 Jun 2013, at 18:23, Gonzalo Aguilar Delgado wrote:

> Hello,
> 
> I'm using wookie to deploy my widgets to rave. I've found something that I don't know how handle.
> 
> When developing in wookie you have a proxy that is managed by policies and it allows you to via javascript make queries to domains that are outside the server.
> 
> While this works out of the box, when you deploy the widget to rave it does not work. Chromiun says something like:
> 
> Unsafe JavaScript attempt to access frame with URL http://localhost:8080/level2-rave-overlay-portal/app/page/view/5 from frame with URL http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/in...0/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080 <http://localhost:8180/wookie/deploy/clt.level2crm.com/widgets/lead_count/index.html?idkey=ABsgy0qnz3zyxeXVX12nlAp4lOw.eq.&proxy=http://localhost:8180/wookie/proxy&st=#rpctoken=UKly2b&oahParent=http%3A%2F%2Flocalhost%3A8080>. Domains, protocols and ports must match.
> 
> 
> This is because wookie is running on port 8180 and Rave is running in port 8080. When making a call to the wookie proxy it fails.
> 
> How should I work around this problem. I suppose that Rave must have it's own proxy or run everything on same port. But I don't want to run everything on the same container, and maybe not even same machine.
> 
> What do you think?

The W3C Widgets are normally rendered within iFrames so a call to the proxy server would be to the same origin, so I'm not sure what is happening here. Are the widgets in IFrames, or rendered inline somehow within Rave?

> 
> Thank you in advance.
> 

S