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

support connecting to neo4j server with http proxy #39

Open
xumng opened this issue Aug 23, 2021 · 0 comments
Open

support connecting to neo4j server with http proxy #39

xumng opened this issue Aug 23, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@xumng
Copy link

xumng commented Aug 23, 2021

  • Laravel Version: 7.0.0
  • PHP Version: 7.4.9
  • NeoEloquent Version: 7.0

Description:

When i connect my neo4j community 3.5.28 in laravel service, it throw an exception as follow:
Vinelab\NeoEloquent\QueryException
Can't open connection to http://localhost:7474/db/data/

I found that Curl.php's function makeRequest haven't set the proxy options.

Steps To Reproduce:

  1. modify Curl.php's function makeRequest and set proxy options.

$options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
CURLOPT_HTTPHEADER => array(
'Accept: application/json;stream=true',
'Content-type: application/json',
'User-Agent: '.Version::userAgent(),
'X-Stream: true'
),
CURLOPT_CUSTOMREQUEST => self::GET,
CURLOPT_POST => false,
CURLOPT_POSTFIELDS => null,
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_PROXYTYPE => CURLPROXY_HTTP, //when neo4j server config http proxy, please set this. reference https://www.php.net/curl_setopt
CURLOPT_PROXY => "", //"http://proxy.example.com:80"
);

Expected result

connected to neo4j server ok.

Actual result

Vinelab\NeoEloquent\QueryException
Can't open connection to http://localhost:7474/db/data/

@xumng xumng added the bug Something isn't working label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant