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

Adding proxy parameters if necessary #63

Closed
deedey opened this issue Jul 4, 2016 · 11 comments
Closed

Adding proxy parameters if necessary #63

deedey opened this issue Jul 4, 2016 · 11 comments
Assignees

Comments

@deedey
Copy link

deedey commented Jul 4, 2016

If your Moodle server is behind a proxy server, you have to add a parameter ad-hoc like this:

    _$http = array(
        //
        // redirects are not part of the spec so LRSs shouldn't be returning them
        //
        'max_redirects' => 0,
        //
        // this is here for some proxy handling
        //
        'request_fulluri' => 1,
        **'proxy'   => '192.168.100.XXX:8080',**
        //
        // switching this to false causes non-2xx/3xx status codes to throw exceptions
        // but we need to handle the "error" status codes ourselves in some cases
        //
        'ignore_errors' => true,
        'method' => $method,
        'header' => array(
            'X-Experience-API-Version: ' . $this->version
        ),
    );_
@nadavkav
Copy link

Just came accros the same issue with Moodle using the "xAPI LogStore" plugin (that uses this code/library)

Thanks for the suggested fix. it helped 😄

I suggest improving the library code to support initiating the class with a new optional proxy param
so Moodle and other projects can propagate their proxy settings.

@ryasmi
Copy link

ryasmi commented Aug 21, 2016

@garemoko any idea when this might be addressed?

@garemoko
Copy link
Contributor

@ryansmith94 no, but certainly sooner if somebody makes a PR. :-)

@deedey @nadavkav does one of you want to take this on?

@deedey
Copy link
Author

deedey commented Aug 22, 2016

@garemoko, @ryansmith94
@nadavkav has launched a same subject in moodle-logstore_xapi.
I think we can close this one, if you agree.

@nadavkav
Copy link

I will upload a PR, soon

@nadavkav
Copy link

@deedey Please do not close this one, as it is a dependancy to a fix I will also upload to moodle-logstore_xapi , later on.

@deedey
Copy link
Author

deedey commented Aug 22, 2016

As you like ,@nadavkav.

@ryasmi
Copy link

ryasmi commented Aug 22, 2016

Yeah I agree with @nadavkav, there is work to be completed in both repos so we need to keep the issues open and close them separately when the work is completed.

@nadavkav
Copy link

Thanks

@deedey
Copy link
Author

deedey commented Aug 23, 2016

Thank you @brianjmiller @nadavkav
It work fine now in moodle-logstore_xapi with your both changes.
The proxy parameters are now recognized automaticly
Great thanks

@nadavkav
Copy link

Super cool 😄

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

No branches or pull requests

5 participants