vti / sockjs-perl Goto Github PK
View Code? Open in Web Editor NEWSockJS Perl Plack/PSGI implementation
License: Other
SockJS Perl Plack/PSGI implementation
License: Other
On a CentOS7 system with the system perl the test suite fails:
...
"any" is not exported by the List::Util module
Can't continue after import errors at /home/cpansand/.cpan/build/2018120210/SockJS-0.08-DX7S4T/blib/lib/SockJS/Transport/Base.pm line 6.
BEGIN failed--compilation aborted at /home/cpansand/.cpan/build/2018120210/SockJS-0.08-DX7S4T/blib/lib/SockJS/Transport/Base.pm line 6.
Compilation failed in require at t/transport/base.t line 6.
BEGIN failed--compilation aborted at t/transport/base.t line 6.
t/transport/base.t ...........
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
... (etc) ...
On this system List::Util 1.27 is installed.
SockJS is not on CPAN.
If it were on CPAN, I would be able to install it more easily, and be able to update it together with the rest of my perl modules.
Now it is hard to make sure it is up-to-date.
Hi,
I'm missing an example that shows how to use the SockJS implementation as a client to send Json RPC2 information via the connection.
KR,
G.
What do you think about multiplexing support in sockjs-perl?
I found these both resources interesting to read:
http://www.rabbitmq.com/blog/2012/02/23/how-to-compose-apps-using-websockets/
http://baudehlo.com/2013/05/07/sockjs-multiple-channels-and-why-i-dumped-socket-io/
With 0.05 and perl 5.12.x the test suite fails:
# Failed test 'No tests run for subtest "return error when content length not equals actual read data"'
# at t/transport/jsonp-send.t line 40.
Can't locate object method "read" via package "IO::File" at /tmpfs/.cpan-build-cpansand/2018082618/SockJS-0.05-2/blib/lib/SockJS/Transport/JSONPSend.pm line 51.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 2.
t/transport/jsonp-send.t .....
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/2 subtests
...
# Failed test 'No tests run for subtest "return error when content length not equals actual read data"'
# at t/transport/xhr-send.t line 40.
Can't locate object method "read" via package "IO::File" at /tmpfs/.cpan-build-cpansand/2018082618/SockJS-0.05-2/blib/lib/SockJS/Transport/XHRSend.pm line 46.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 2.
t/transport/xhr-send.t .......
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/2 subtests
I vaguely remember that this can be fixed with a "use IO::File", but I can be wrong.
With older perls (5.10.x, 5.8.x) the error message is different:
Can't locate object method "read" via package "IO::Handle" at /home/cpansand/.cpan/build/2018082618/SockJS-0.05-0/blib/lib/SockJS/Transport/JSONPSend.pm line 51.
My smokers started to report test failures:
...
# Failed test at t/transport/jsonp-send.t line 85.
# Structures begin differing at:
# $got->[0] = '200'
# $expected->[0] = '500'
# Looks like you failed 1 test of 1.
# Failed test 'return error when broken JSON'
# at t/transport/jsonp-send.t line 91.
# Looks like you failed 1 test of 7.
t/transport/jsonp-send.t .....
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
...
# Failed test at t/transport/xhr-send.t line 85.
# Structures begin differing at:
# $got->[0] = '204'
# $expected->[0] = '500'
# Looks like you failed 1 test of 1.
# Failed test 'return error when broken JSON'
# at t/transport/xhr-send.t line 91.
# Looks like you failed 1 test of 6.
t/transport/xhr-send.t .......
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests
I suspect that this is caused by JSON::XS 4.00
Hi,
It seems to me that Test::MonkeyMock is missing.
I noticed when I saw:
http://www.cpantesters.org/cpan/report/6d86c4bd-6bf3-1014-be49-80688f8dfe5c
http://www.cpantesters.org/cpan/report/847f3df0-a92b-11e8-984f-93f68aa1d4d1
--
Thank you,
Probably the distribution should declare 5.010 as minimum perl version --- or alternatively get rid of defined-or usage. I see with perl 5.8.1 the following error in the test suite:
Search pattern not terminated at /tmpfs/.cpan-build-cpansand/2018082615/SockJS-0.04-jQK0kG/blib/lib/SockJS/Middleware/Cors.pm line 22.
Compilation failed in require at t/middleware/cors.t line 6.
BEGIN failed--compilation aborted at t/middleware/cors.t line 6.
t/middleware/cors.t ..........
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
I get the following error, when Chrome Browser is connected using SockJS by wecksocket connection, and i hit reload in the browser:
Can't call method "push_write" on an undefined value at /usr/local/share/perl/5.14.2/SockJS/Transport/WebSocket.pm line 106
... and the perl script aborts.
Without supplying a Content-Length
, responses were automatically chunked by Middleware::Chunked. I produced the following with the supplied test client, testing on Firefox and Chromium -- removing the chunked middleware or adding a Content-Length
to a response resolved the issue in the response and browser.
GET /echo/info HTTP/1.1
HTTP/1.0 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Access-Control-Allow-Headers: origin, content-type
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Transfer-Encoding: chunked
4f
{"origins":["*:*"],"entropy":3562916858,"websocket":true,"cookie_needed":false}
0
In the top-level README.md of this module, you get "The Client-Side Part" and "The Server-Side Part". I tried those out with Twiggy, using both version 0.3.4 and version 0.2.1 of the client, and when I try to load my webpage I get the following error on FireBug (latest FF):
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
[Break On This Error]
var info = JSON.parse(text); sockjs-0.2.1.js (line 1649)
So I look at the client code and insert a debugging line: console.log(text) right before JSON-parsing it, and see that text is not JSON at all! See for yourself below:
4f
{"origins":["*:*"],"entropy":3020163857,"websocket":true,"cookie_needed":false}
0
The "4f' and the "0" on the top & bottom are creating the problem.
Whose fault is it, vti? What can we do to fix it? I'm anxious to become a SockJS-Perl user!
Thanks
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.