obsh / sse-client Goto Github PK
View Code? Open in Web Editor NEWServer Sent Event client implementation
License: MIT License
Server Sent Event client implementation
License: MIT License
Please update to guzzlehttp/guzzle >7 as most plugins nowedays do so, and version 6 has errors
I'm currently running into issues which I have tracked down but am not sure how to resolve:
Line 51 in 4f459f7
stream = true causes the error:
<GET https://localhost:3000/db/my-feed/events/load> [CONNECT]
<GET https://localhost:3000/db/my-feed/events/load> [AUTH_RESULT] severity: "2" message: "HTTP/1.0 403 Forbidden
" message_code: "403"
<GET https://localhost:3000/db/my-feed/events/load> [MIME_TYPE_IS] message: "text/plain"
<GET https://localhost:3000/db/my-feed/events/load> [PROGRESS]
PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://localhost:3000/db/my-feed/events/load` resulted in a `403 Forbidden` response in /home/haydenyoung/html/orbitdb/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
However, if I remove stream true, it looks fine (debug=true enabled on request):
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3000 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=AU; ST=A; L=B; O=Organization; OU=OrganizationUnit; CN=localhost; [email protected]
* start date: May 25 14:56:35 2019 GMT
* expire date: Oct 6 14:56:35 2020 GMT
* common name: localhost (matched)
* issuer: C=AU; ST=A; L=B; O=Internet Widgits Pty Ltd; CN=Local Certificate
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x558b8007c8a0)
> GET /db/zdpuAoZQznotzijaUCrgUEQkPVCH64RCmGHPXUnRPX5EQn3L1%2Fmy-feed2/events/replicate.progress HTTP/2
Host: localhost:3000
Accept: text/event-stream
Cache-Control: no-cache
User-Agent: GuzzleHttp/6.3.3 curl/7.58.0 PHP/7.2.17-0ubuntu0.18.04.1
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< content-type: text/event-stream; charset=utf-8
< content-encoding: identity
< cache-control: no-cache
< vary: accept-encoding
< date: Sat, 25 May 2019 15:10:38 GMT
But without stream true I can't access the network stream. I'm wondering if this issue is deeper down in the GuzzleHttp lib?
I'm using a self signed cert but have generated a local CA cert which I have added to the local CA store. curl and guzzle seem to be able to resolve the cert without problem (I'm not disabling it using flags like curl -k).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.