http://qs1969.pair.com?node_id=11112740


in reply to Re: Help with converting HTTP::Request to Plack::Request
in thread Help with converting HTTP::Request to Plack::Request

The context: I had a working local FCGI script that i was converting to Plack step by step. It was going smoothly until it got to the posted code. For some reason I couldn't get an error code or line number, just: "failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: polyneura.local, request: "POST /index.cgi HTTP/1.1", upstream: "http://127.0.0.1:5000". I should have posted it here.

Plack/PSGI is server side. It doesn’t, so far, make sense to answer your question with Plack code.

This was really helpful, it wasn't obvious to me until you mentioned it. While it didn't directly solve my problem, it was a light bulb moment for me as I thought that every type of request had to wrapped up in some sort of Plack handler.

Only the client knows about fragments; you can scan the YAML dump and see everything the server code gets.

This is cool, thanks! After further testing, I found that LWP::Protocol::https was not installed. This confused me, because it was working on my local fcgi script (I'll check this later). So I went through the process of installing LWP::Protocol::https which yielded more errors:

! Installing the dependencies failed: Module 'Net::SSLeay' is not inst +alled ! Bailing out the installation for IO-Socket-SSL-2.066.

! tail /home/<userhome>/.cpanm/work/1581360095.6546/build.log ^ rm -f blib/arch/auto/Net/SSLeay/SSLeay.so LD_RUN_PATH="/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu" cc -sha +red -O2 -L/usr -L/usr/lib -L/usr/local/lib -fstack-protector-strong +SSLeay.o -o blib/arch/auto/Net/SSLeay/SSLeay.so \ -L/usr -L/usr/lib -lssl -lcrypto -lz \ /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status Makefile:493: recipe for target 'blib/arch/auto/Net/SSLeay/SSLeay.so' +failed make: *** [blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1 -> FAIL Installing Net::SSLeay failed. See /home/<userhome>/.cpanm/wor +k/1581360095.6546/build.log for details. Retry with --force to force +install it.

I found this: https://stackoverflow.com/questions/3373995/usr-bin-ld-cannot-find-lz and installed sudo apt-get install zlib1g-dev. I haven't got around to changing to URI yet, but I will make some changes soon. Thanks for that. Apologies if this was long winded, but I figure someone out there could learn from my mistakes.