Comments (9)
ping @clue, could this possibly be in the SSL part of react/socket-client?
from http-client.
This also happens at the socket-client level, this is an example (without actually parsing the response to exit cleanly):
<?php
require_once 'vendor/autoload.php';
$url = "https://example.com";
$mp = new p3k\Multipart;
$mp->addPart('field', ''value');
$mp->addFile('photo', 'small-98kb.jpeg'', 'image/jpeg');
$loop = React\EventLoop\Factory::create();
$dnsFactory = new React\Dns\Resolver\Factory();
$dns = $dnsFactory->createCached('192.168.2.1', $loop);
$tcpConnector = new React\SocketClient\TcpConnector($loop);
$dnsConnector = new React\SocketClient\DnsConnector($tcpConnector, $dns);
$connector = new React\SocketClient\SecureConnector($dnsConnector, $loop, ['verify_peer' => false]);
$loop->nextTick(function() use ($connector, $url, $mp) {
$urlparts = parse_url($url);
$connector->create($urlparts['host'], 443)
->then(function (React\Stream\Stream $stream) use ($mp, $urlparts) {
$stream->write(
"POST {$urlparts['path']} HTTP/1.0\r\n" .
"Host: {$urlparts['host']}\r\n" .
"Content-Type: ".$mp->contentType()."\r\n" .
"Content-Length: ".strlen($mp->data())."\r\n" .
"Connection: close\r\n" .
"\r\n" .
$mp->data()
);
$stream->on('data', function($data) {
print "DATA = \n{$data}\n";
});
$stream->on('close', function() {
print "DONE\n";
});
//$stream->end();
});
});
while (1) $loop->run();
from http-client.
I also tested it with a small file and it worked perfectly.
from http-client.
the connection simply hangs
Thanks for letting us know, but from the details you've posted, the problem appears to be a bit unclear to me. Perhaps you can elaborate: What exactly is hanging here, what is the expected behavior and how does the observed behavior differ?
There are many different possible sources of problems, perhaps this helps pinpointing this. Thanks!
Could we perhaps be running into HTTP's keepalive connection timeouts here?
from http-client.
Ping @pwhelan, and new info on this on?
from http-client.
I fixed it by using by own external micro service in golang to upload files via https. As far as I can tell no one else has followed up with the different issues to finally fix this. From what I can tell it seems to be a problem either in PHP itself or in the way it is handled by react socket client.
from http-client.
From what I can tell it seems to be a problem either in PHP itself or […]
Please provide us with some more details so we can look into this (see above). So far, nobody has managed to run into the issue you're seeing, so I'm not sure there's a problem in any of the mentioned components in the first place.
from http-client.
We still need some more information / confirmation here, but I suppose this may be related to reactphp/stream#64, which indicates this is a general issues with sending large chunks over a TLS connection.
from http-client.
We have managed to reproduce and pin point this to a bug in PHP that has recently been fixed in 7.1.4 and 7.0.18. We're planning to provide a work around for this for affected versions via reactphp/socket#105 👍
from http-client.
Related Issues (20)
- Time Out Question HOT 1
- question regarding writing HOT 2
- Hanging connector HOT 1
- Unable to validate "1 " as chunk length header HOT 3
- strtolower() expects parameter 1 to be string, array given HOT 1
- Delay Request Connection HOT 6
- Error on "close" event HOT 8
- How to get the full response body? HOT 1
- [bug]Concurrent with more than 1000 requests. HOT 4
- client pool HOT 1
- Memory leak in SecureConnector HOT 4
- Integrate Server Sent event api (EventSource) or streaming HTTP api HOT 1
- Support detecting response body boundaries HOT 1
- Can this library be used in php-fpm mode? HOT 2
- Trying to POST multipart/form-data HOT 2
- Support for certificate authentication when using HttpClientAdapter HOT 1
- Stop streaming half-way. HOT 1
- Support HTTP upgrades (WebSocket etc.) HOT 1
- is $loop->run(); blocking? HOT 4
- Heads up! Development focus on react/http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-client.