On 12.07.20 02:14, Iuri de Araujo Sampaio wrote:
However, when I run the first version of the code, and it returns an
error related to: *Error: can't set "formMap": variable is array*
*
*
/usr/local/src/ns-4.9.17/tcl8.6.8/library/http/http.tcl:return [string
map $formMap $string]
/usr/local/src/tcl8.6.9/library/http/http.tcl:variable formMap [array
get map]
The error is related to core packages, and I believe it happens to
fail because that source is some sort of an old code. Thus, it’s not a
good idea to fork it at all.
Dear Iuri,
this error comes form the tcllib (and it seems, you have two versions of
tcllib installed). This error is not related with NaviServer, i have no
knowledge about the internals of the tcllibs' http package.
As you have noticed, i have added a simple client side interface to the
websocket package of NaviServer on bitbucket. In essence, this means to
add support for "masked" messages, which are required for client frames
for WebSockets.
I've also added client-side SNI support to ns_connchan to be able to
connect to a server with virtual hosting via HTTPS that provides
multiple certificates via SNI (Server Name Indication). So the current
version of the NaviServer websocket module (just committed) requires as
well the current version of NaviServer.
Don't expect this little interface (client-side websocket: ~150 LOC) to
be feature complete. It does not handle e.g. WebSocket continuations,
etc. ... but the following snippet should work ok.
-gn
===========
set WSURL wss://javascript.info/article/websocket/demo/hello
set chan [ws::client::open $WSURL]
# Send "Hello Wörld" to the echo service
ws::client::send $chan "Hello Wörld"
# Get the reply and decode it (will return "Hello from server, Wörld!")
set replyText [ws::client::receive $chan]
# ... do some more work and finally close the channel
ws::client::close $chan
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel