Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vcloud.js #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update vcloud.js #1

wants to merge 1 commit into from

Conversation

flamby
Copy link

@flamby flamby commented Mar 6, 2013

how to deal with proxy as in silver lining?
thanks in advance.

how to deal with proxy as in silver lining?
thanks in advance.
@ali5ter
Copy link
Owner

ali5ter commented Mar 7, 2013

Hey there. Thanks for trying out this repo. What are you trying to do exactly?

I think you're referring to the SIlverLining main.js where there's a commented out code block with the comment starting 'Adds a prefilter'? It looks like this was code that should have been deleted rather than commented out since it seems to refer to a previous architecture that ran the whole SilverLining client from a java proxy server to get around the cross-domain issues. This was replaced with simply placing the SDK js lib and web application code into the vCD cell itself.

@flamby
Copy link
Author

flamby commented Mar 7, 2013

Hi,
Thanks for your answer. The use case is precisely to not host it on the vCD cells, for white-label web portal purpose.
That's why i've set up a proxy which works (my curl tests through it work) but i can't get vcloud-client nor silver lining to maintain the x-vcloud-authorization header from one request to another (the first ones which use the query service work, but when it comes to POST request like "stop vapp", the header is not send to my proxy.

Seems my ajaxprefilter is not placed in the proper place.

@ali5ter
Copy link
Owner

ali5ter commented Mar 7, 2013

That's great! So just curious: Have you been able to manually post API calls (using a rest client that available from http://www.wiztools.org/) through your proxy and get successful responses?

If you're open to it, maybe you could share your proxy code and I could try to set it up between my dev vCD and the client and try to replicate the problem you're seeing? I'm travelling right now but I should be able to get to it later over the week-end.

@flamby
Copy link
Author

flamby commented Mar 7, 2013

Yep, POST, PUT through my proxy are fine. See where your fling can be used, a wide use-case of white-labeling VCD web portal (which in my thought vCAC is not suitable for, for now at least ; due to the lack of easy customization).

The proxy is in python / django. Maybe it would be better to rely on one in js. Also, as it's for a client developer, I'm pretty sure i can't open source it, even if it's a stupid/simple proxy implemented for the VCD authentication use-case. Nevertheless, I can send it to you in order to ease the troubleshooting of what's not working on the js side.

@ali5ter
Copy link
Owner

ali5ter commented Mar 7, 2013

Couldn't agree more. Wanted to supply a simple proxy that could easily be slipped under the vcloud-js-sdk to remove the need to install directly on the vCD cell. Would provide useful proxy for console access too. Selfishly, I was hoping you might have something you could make public so I didn't have to do it ;) No worries!

If you send, obviously I'll only use for debugging. However, the thought of a proxy (using node.js perhaps) is well noted.

@flamby
Copy link
Author

flamby commented Mar 7, 2013

I think I catched an issue with the lib I use in my proxy function (httplib2) regarding the returned xml payload (payload is truncated).
I'm trying to use another lib (requests) to workaround this issue.
If it's a lib bug, perhaps the commented code I pulled works like a charm.
I should have time by tomorrow to dig into it.

The proxy for console access will be probably more difficult to address.

@flamby
Copy link
Author

flamby commented Mar 7, 2013

Indeed, it was a problem in my proxy. POST requests work now.
I send to your alister-github@different.com email my django proxy function. It should be easy to port to node.js

BTW I face another issue, when clicking in Library button, I get disconnected. (I tested w/ silverlining and will test with vcloud-client tomorrow).

@ali5ter
Copy link
Owner

ali5ter commented Mar 7, 2013

Thank you! Will take a look. Let me know what you find out with the Library button.

@flamby
Copy link
Author

flamby commented Mar 8, 2013

this nodejs http proxy can probably do the trick :
https://github.com/nodejitsu/node-http-proxy

its websocket support will even permit to have html5 vm console access :-)

@flamby
Copy link
Author

flamby commented Mar 20, 2013

Hi Alister,

After having looked at both WSX and VCD consoleproxy sources (using java
decompiler for the last one) i've made little progress.
I see that after having retrieved the screenTicket from VCD API, I need to
do some SOAP requests on the consoleproxy ip address (port 443) which seems
to mimic the ESX behaviour regarding vm console access., which should lead
to a websocket token that i need to pass to wmks.js function.

Regarding proxying this websocket connection, I think it's not something
mandatory in my use-case as the console access can be done directly from
the client to the real VCD cell, which the customer won't see, except if he
looks at the firebug-like extension level.

Anyway, have you find time to look at the node.js proxy module I suggested?

BR

On Thu, Mar 7, 2013 at 8:47 PM, Alister Lewis-Bowen <
notifications@github.com> wrote:

Thank you! Will take a look. Let me know what you find out with the
Library button.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-14581931
.

@ali5ter
Copy link
Owner

ali5ter commented Mar 20, 2013

Hi David. Alas, I have not. I'm sorry. This may take a while given my current workload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants