You can subscribe to this list here.
2005 |
Jan
|
Feb
(53) |
Mar
(62) |
Apr
(88) |
May
(55) |
Jun
(204) |
Jul
(52) |
Aug
|
Sep
(1) |
Oct
(94) |
Nov
(15) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(130) |
Feb
(105) |
Mar
(34) |
Apr
(61) |
May
(41) |
Jun
(92) |
Jul
(176) |
Aug
(102) |
Sep
(247) |
Oct
(69) |
Nov
(32) |
Dec
(140) |
2007 |
Jan
(58) |
Feb
(51) |
Mar
(11) |
Apr
(20) |
May
(34) |
Jun
(37) |
Jul
(18) |
Aug
(60) |
Sep
(41) |
Oct
(105) |
Nov
(19) |
Dec
(14) |
2008 |
Jan
(3) |
Feb
|
Mar
(7) |
Apr
(5) |
May
(123) |
Jun
(5) |
Jul
(1) |
Aug
(29) |
Sep
(15) |
Oct
(21) |
Nov
(51) |
Dec
(3) |
2009 |
Jan
|
Feb
(36) |
Mar
(29) |
Apr
|
May
|
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(4) |
Oct
|
Nov
(13) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(9) |
Apr
(11) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(92) |
Nov
(28) |
Dec
(16) |
2013 |
Jan
(9) |
Feb
(2) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(6) |
Jul
(14) |
Aug
(12) |
Sep
(4) |
Oct
(13) |
Nov
(1) |
Dec
(6) |
2014 |
Jan
(23) |
Feb
(19) |
Mar
(10) |
Apr
(14) |
May
(11) |
Jun
(6) |
Jul
(11) |
Aug
(15) |
Sep
(41) |
Oct
(95) |
Nov
(23) |
Dec
(11) |
2015 |
Jan
(3) |
Feb
(9) |
Mar
(19) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
|
2016 |
Jan
(7) |
Feb
(11) |
Mar
(8) |
Apr
(1) |
May
(3) |
Jun
(17) |
Jul
(12) |
Aug
(3) |
Sep
(5) |
Oct
(19) |
Nov
(12) |
Dec
(6) |
2017 |
Jan
(30) |
Feb
(23) |
Mar
(12) |
Apr
(32) |
May
(27) |
Jun
(7) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(11) |
Nov
|
Dec
(12) |
2018 |
Jan
(1) |
Feb
(5) |
Mar
(6) |
Apr
(7) |
May
(23) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(6) |
Oct
(6) |
Nov
(10) |
Dec
(3) |
2019 |
Jan
(26) |
Feb
(15) |
Mar
(9) |
Apr
|
May
(8) |
Jun
(14) |
Jul
(10) |
Aug
(10) |
Sep
(4) |
Oct
(2) |
Nov
(20) |
Dec
(10) |
2020 |
Jan
(10) |
Feb
(14) |
Mar
(29) |
Apr
(11) |
May
(25) |
Jun
(21) |
Jul
(23) |
Aug
(12) |
Sep
(19) |
Oct
(6) |
Nov
(8) |
Dec
(12) |
2021 |
Jan
(29) |
Feb
(9) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
(2) |
Jul
(9) |
Aug
(9) |
Sep
(3) |
Oct
(4) |
Nov
(12) |
Dec
(13) |
2022 |
Jan
(4) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(15) |
Jun
(7) |
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2023 |
Jan
(15) |
Feb
|
Mar
(23) |
Apr
(1) |
May
(2) |
Jun
(10) |
Jul
|
Aug
(22) |
Sep
(19) |
Oct
(2) |
Nov
(20) |
Dec
|
2024 |
Jan
(1) |
Feb
|
Mar
(16) |
Apr
(15) |
May
(6) |
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(13) |
Nov
(18) |
Dec
(6) |
2025 |
Jan
(12) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(11) |
Jun
(5) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gustaf N. <ne...@wu...> - 2020-08-28 10:37:01
|
Dear Oleg, many thanks for these fixes, all look good, everything is still fine on my test setups. i've already applied these on bitbucket. @Andrew: please check these as well with your setup. One question though: is the trick with '--data @- << $string' really the recommended way to pass utf-8 data in windows? all the best -g On 28.08.20 11:27, oleg wrote: > Hello. > > A few words about the latest version of Naviserver on Windows. > > Current Makefile.win32 worked fine (32-bit with Tcl 8.6). > > Some minor fixes were required in the source code (attached > naviserver-win32.diff): > * include\Makefile.win32 - fix syntax error when NAVISERVER is > defined (expression without quotes), > * nsd\Makefile - move file dependencies below Makefile.build > include, nmake only creates first dependency, > * nsd\nswin32.c - nsconf.config should be renamed to > nfconf.configFile in accordance with the nsd.h change, > * tests\all.tcl - add 'encoding system utf-8' at the beginning to > for satisfy encoding.test on non-utf8 consoles, > * tests\http.test (http-5.3b,http-9.1) - replace 'curl --data > $string' by 'curl --data @- << $string' to preserve utf-8 data. > > Also, I have included zlib from the tcl 8.6 source tree. See attached > nsd-Makefile.win32 - small hack to the source tree, simply save as > nsd\Makefile.win32 and rebuild nsd/libnsd. Note hardcoded path to zlib > sources. > > The test suite completed with the following result (ns_proxy.test > skipped) > > all.tcl: Total 1542 Passed 1496 > Skipped 28 Failed 18 Sourced 69 Test Files. > > Thanks for the great job! > > Regards > Oleg. > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: oleg <oo...@ua...> - 2020-08-28 09:28:01
|
Hello. A few words about the latest version of Naviserver on Windows. Current Makefile.win32 worked fine (32-bit with Tcl 8.6). Some minor fixes were required in the source code (attached naviserver-win32.diff): * include\Makefile.win32 - fix syntax error when NAVISERVER is defined (expression without quotes), * nsd\Makefile - move file dependencies below Makefile.build include, nmake only creates first dependency, * nsd\nswin32.c - nsconf.config should be renamed to nfconf.configFile in accordance with the nsd.h change, * tests\all.tcl - add 'encoding system utf-8' at the beginning to for satisfy encoding.test on non-utf8 consoles, * tests\http.test (http-5.3b,http-9.1) - replace 'curl --data $string' by 'curl --data @- << $string' to preserve utf-8 data. Also, I have included zlib from the tcl 8.6 source tree. See attached nsd-Makefile.win32 - small hack to the source tree, simply save as nsd\Makefile.win32 and rebuild nsd/libnsd. Note hardcoded path to zlib sources. The test suite completed with the following result (ns_proxy.test skipped) all.tcl: Total 1542 Passed 1496 Skipped 28 Failed 18 Sourced 69 Test Files. Thanks for the great job! Regards Oleg. |
From: Maksym Z. <siq...@gm...> - 2020-08-15 23:55:12
|
Hello Thorpe, Im not sure if this question is related to Naviserver. It looks like you have more application logic error or smth. As I understood from your email its 2 lines you get from DB or smth, shopping_cart_id looks identical ( 186467 186467 --- may be it is a typo), but try to check your code, may be use dict, for example when you run query get resul as a dict in format "column_name" "value" etc. Im pretty sure it has nothing to do with TDBC or Naviserver. Maksym Zinchenko On Sat, Aug 15, 2020 at 7:54 PM THORPE MAYES via naviserver-devel < nav...@li...> wrote: > HI, > > I am using TDBC to connect to a postgresql database. > > I am getting strange behavior with a tcl foreach statement. > > Here is the list I am stepping through: > > LIST: {186467 2225 1 122 771 {6 inch Ham Sub} 1 5.75 t {Plain no cheese} > t White t Chips f {} {}} {186467 2225 2 13 1192 {Smoothie with chips} 1 > 5.50 t strawberry f {} f {} f {} {}} > > The first element in each sub-list in the list is the shopping_cart_id > > When I move through the list I assign values to variables using lassign > > Every once and a while the variables are not assigned values. For example, > I get an error saying that shopping_cart_id does not exist when I try to > use in in the foreach loop. > > I have never had this issue before. > > The major difference in this project is that I am using TDBC to connect to > the database. > > Is there a problem with TDBC that might cause this behavior? > > Thank you. > > Thorpe > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: THORPE M. <ta...@me...> - 2020-08-15 20:53:58
|
HI, I am using TDBC to connect to a postgresql database. I am getting strange behavior with a tcl foreach statement. Here is the list I am stepping through: LIST: {186467 2225 1 122 771 {6 inch Ham Sub} 1 5.75 t {Plain no cheese} t White t Chips f {} {}} {186467 2225 2 13 1192 {Smoothie with chips} 1 5.50 t strawberry f {} f {} f {} {}} The first element in each sub-list in the list is the shopping_cart_id When I move through the list I assign values to variables using lassign Every once and a while the variables are not assigned values. For example, I get an error saying that shopping_cart_id does not exist when I try to use in in the foreach loop. I have never had this issue before. The major difference in this project is that I am using TDBC to connect to the database. Is there a problem with TDBC that might cause this behavior? Thank you. Thorpe |
From: Gustaf N. <ne...@wu...> - 2020-08-14 10:32:07
|
> Is it possible to revert old -r behavior when config can be placed > outside of the chroot point? A change 6 days ago has introduced the testing flag "-T" where also the code locality was improved. This moved the reading of the configuration file after the chroot() command. This is fixed now and is commented in the source code Many thanks for the good bug report! -g On 14.08.20 08:51, oleg wrote: > Hello. > > I noticed that the naviserver behavior in the chroot mode (command line > switch -r <path>) has changed in the latest version of the server > (4.77.20a). > > Now the configuration is loaded by the server AFTER performing the > chroot, so the config file located out of the chroot box becomes > inaccessible. > > Script to reproduce (var NS contains buildname): > > rm -rf /tmp/ns > mkdir /tmp/ns > mkdir /tmp/ns/etc > mkdir /tmp/ns/bin > mkdir /tmp/ns/lib > grep nsadmin /etc/passwd > /tmp/ns/etc/passwd > cp -a /opt/$NS/bin/init.tcl /tmp/ns/bin/ > cp -a /opt/$NS/lib/tcl8.6 /tmp/ns/lib/ > echo error error > /tmp/ns.tcl > /opt/$NS/bin/nsd -V > sudo env -i TCL_LIBRARY=/lib/tcl8.6 /opt/$NS/bin/nsd -u nsadmin -t > /tmp/ns.tcl -r /tmp/ns -f > > Outputs for current and older naviserver: > --- > NaviServer/4.99.20a > Tag: ae638d77dc90 > Built: Aug 13 2020 at 12:48:41 > Tcl version: 8.6 > Platform: linux > [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: OpenSSL > 1.1.1c FIPS 28 May 2019 initialized > [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: binder: > started [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Fatal: > config: can't open configuration file '/tmp/ns.tcl': 'No such file or > directory' [13/Aug/2020:17:28:11][72992.7f12f0199740][binder] Notice: > binder: stopped > -- > -- > NaviServer/4.99.19 > Tag: tar-4.99.19 > Built: Aug 13 2020 at 16:41:28 > Tcl version: 8.6 > Platform: linux > [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: OpenSSL > 1.1.1c FIPS 28 May 2019 initialized > [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: binder: > started [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Error: error > error while executing > "error error" > (context: config eval) > [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Fatal: config error > [13/Aug/2020:17:27:47][72960.7fc289aa6740][binder] Notice: binder: > stopped > --- > > Is it possible to revert old -r behavior when config can be placed > outside of the chroot point? > > Regards, > Oleg/ > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: oleg <oo...@ua...> - 2020-08-14 07:16:01
|
Hello. I noticed that the naviserver behavior in the chroot mode (command line switch -r <path>) has changed in the latest version of the server (4.77.20a). Now the configuration is loaded by the server AFTER performing the chroot, so the config file located out of the chroot box becomes inaccessible. Script to reproduce (var NS contains buildname): rm -rf /tmp/ns mkdir /tmp/ns mkdir /tmp/ns/etc mkdir /tmp/ns/bin mkdir /tmp/ns/lib grep nsadmin /etc/passwd > /tmp/ns/etc/passwd cp -a /opt/$NS/bin/init.tcl /tmp/ns/bin/ cp -a /opt/$NS/lib/tcl8.6 /tmp/ns/lib/ echo error error > /tmp/ns.tcl /opt/$NS/bin/nsd -V sudo env -i TCL_LIBRARY=/lib/tcl8.6 /opt/$NS/bin/nsd -u nsadmin -t /tmp/ns.tcl -r /tmp/ns -f Outputs for current and older naviserver: --- NaviServer/4.99.20a Tag: ae638d77dc90 Built: Aug 13 2020 at 12:48:41 Tcl version: 8.6 Platform: linux [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: OpenSSL 1.1.1c FIPS 28 May 2019 initialized [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: binder: started [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Fatal: config: can't open configuration file '/tmp/ns.tcl': 'No such file or directory' [13/Aug/2020:17:28:11][72992.7f12f0199740][binder] Notice: binder: stopped -- -- NaviServer/4.99.19 Tag: tar-4.99.19 Built: Aug 13 2020 at 16:41:28 Tcl version: 8.6 Platform: linux [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: OpenSSL 1.1.1c FIPS 28 May 2019 initialized [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: binder: started [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Error: error error while executing "error error" (context: config eval) [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Fatal: config error [13/Aug/2020:17:27:47][72960.7fc289aa6740][binder] Notice: binder: stopped --- Is it possible to revert old -r behavior when config can be placed outside of the chroot point? Regards, Oleg/ |
From: Gustaf N. <ne...@wu...> - 2020-08-13 09:48:23
|
Dear all, You might have followed the discussion about inclusive language, esp. avoiding sexist, racist, or ethnocentric language usage in technical communication. There is an IETF document [1] under development, addressing goals and developing recommendations. Kevin Kenny mentioned on the Tcl-core list that there are jurisdictions in which these words are prohibited by law in deliveries on government contracts. I have checked the NaviServer sources for potentially offending terminology and have replaced occurrences in [2]. Please check as well, and propose/prepare more changes, if you think it is appropriate. all the best -g [1] https://tools.ietf.org/html/draft-knodel-terminology-03 [2] https://bitbucket.org/naviserver/naviserver/commits/ae638d77dc904fdd4142f8cb091c22067a9137a8 |
From: Gustaf N. <ne...@wu...> - 2020-08-08 09:22:20
|
Dear all, The update version of NaviServer has now the OCSP stapling code finished. It works with SNI (i.e. for one driver multiple certificates) and automatic invalidation/re-fetching of timed out OCSP responses. all the best -gn On 24.02.20 21:40, Gustaf Neumann wrote: > OCSP stapling is now committed to bitbucket (including documentation > update) > > https://bitbucket.org/naviserver/naviserver/commits/c204be39e1ffb87c1e368335dfe0750c1cea9bb3 > > > -g |
From: Gustaf N. <ne...@wu...> - 2020-07-25 14:05:42
|
On 08.07.20 17:33, Maksym Zinchenko wrote: > Thank you, very much. I'm going to implement it right now. Dear Maksym, server-side SNI should be now fully implemented (including OCSP and SNI, which are technically not SNI related, but required some refactoring due to virtual hosting, which is not a driver (nssock, nsssl, ...) matter). if possible, please test, ... and check as well the new manual page in "manual" -> "admin-config" all the best -g |
From: Iuri de A. S. <iu...@iu...> - 2020-07-14 20:21:11
|
Thanks Gustaf, I’m going to uninstall the older version of TCLLIB. Yes it works! It’s more than enough! In fact, since your previous commit, last Sunday the weekend, I was able to understand the implementation "workflow" and aspects of writing a client app in the backend scene. I’m going to download the latest commit and try it out. Furthermore, Chat and log-viewer samples are very nice and clean. You guys have separated very well the frontend app and backend in the ADP and TCL files respectively. Best wishes, I > On Dhuʻl-Q. 23, 1441 AH, at 08:08, Gustaf Neumann <ne...@wu...> wrote: > > 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 <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 > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Gustaf N. <ne...@wu...> - 2020-07-14 11:08:57
|
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 |
From: Iuri de A. S. <iu...@iu...> - 2020-07-13 00:53:39
|
The errors related to [dict] have been fixed, adding the following lines within websocket-procs.tcl … nsf::proc ::ws::client::open {url} { ... line 437 if {[dict exists $d path] ne ""} { set path [dict get $d path] append request_url /$path } if {[dict exists $d tail] ne ""} { set tail [dict get $d tail] append request_url /$tail } Even though, I still see no reason your code would break, because the wss sample does return “path”. The case of failure is when the websocket doesn’t return neither path nor tail. >> The websocket sample is "wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello>" [12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Notice: D proto wss host javascript.info path article/websocket/demo tail hello Now, I’ve hit another situation. That error seems more serious. :) 12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Notice: Running TCL script luna.tcl [12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Notice: D proto wss host javascript.info path article/websocket/demo tail hello [12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Notice: SockConnect: target host <javascript.info> has associated multiple IP addresses <104.26.12.17 104.26.13.17 172.67.74.41> [12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Notice: async connect to 104.26.12.17 on sock 27 returned EINPROGRESS [12/Jul/2020:21:44:37][23102.7efbf356f700][-conn:iurix:1:92-] Error: ssl connect failed: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure while executing "ns_connchan open -headers $headers -version 1.1 $request_url" (procedure "ws::client::open" line 30) invoked from within "ws::client::open $url" ("uplevel" body line 8) invoked from within "uplevel { (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/ws-sample" line 2) invoked from within "code::tcl::$__adp_stub" ("uplevel" body line 12) invoked from within "uplevel { if { [file exists $__adp_stub.tcl] } { # ensure that data source preparation procedure exists and is up-to-date ..." (procedure "adp_prepare" line 2) invoked from within "adp_prepare" invoked from within "template::adp_parse $themed_template {}" (procedure "adp_parse_ad_conn_file" line 14) invoked from within "$handler" ("uplevel" body line 2) invoked from within "uplevel $code" invoked from within "ad_try { $handler } ad_script_abort val { # do nothing }" invoked from within "rp_serve_concrete_file [ad_conn file]" > On Dhuʻl-Q. 21, 1441 AH, at 21:14, Iuri de Araujo Sampaio <iu...@iu...> wrote: > > … I've hit “send” button by mistake…. > > Hi Gustaf > I’ve noticed you had uploaded a simple client interface to websocket-procs.tcl. > https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl <https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl> > > However, I hit another error related to [dict], because the url doesn’t return a path, when [dict get $d path] runs. > > The websocket sample is "wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello>”,which returns the following content > > [12/Jul/2020:21:10:09][22414.7efbf37fe700][-conn:iurix:0:9-] Notice: D > proto wss host javascript.info <http://javascript.info/> path article/websocket/demo tail hello > > > > I’m going to continue writing this client. I don’t know if you are in the middle the implementation but I shall thank you in advance. That’s been very helpful already. > > Best wishes, > I > > >> On Dhuʻl-Q. 21, 1441 AH, at 21:08, Iuri de Araujo Sampaio <iu...@iu... <mailto:iu...@iu...>> wrote: >> >> Hi Gustaf, >> I’ve noticed you had uploaded a simple client interface to websocket-procs.tcl. >> https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl <https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl> >> >> However, I hit another error related to [dict], because the url doesn’t return a path, when [dict get $d path] runs. >> The websocket sample is "wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello>" >> >> Best wishes, >> I >> >> >> > [12/Jul/2020:21:10:09][22414.7efbf37fe700][-conn:iurix:0:9-] Notice: D > proto wss host javascript.info <http://javascript.info/> path article/websocket/demo tail hello >> [12/Jul/2020:21:03:33][22342.7efbf37fe700][-conn:iurix:0:36-] Error: can't read "path": no such variable >> while executing >> "append request_url /$path" >> (procedure "ws::client::open" line 19) >> invoked from within >> "ws::client::open $url" >> ("uplevel" body line 8) >> invoked from within >> "uplevel { >> ns_log Notice "Running TCL script luna.tcl" >> >> (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/luna" line 2) >> invoked from within >> "code::tcl::$__adp_stub" >> ("uplevel" body line 12) >> invoked from within >> "uplevel { >> >> if { [file exists $__adp_stub.tcl] } { >> >> # ensure that data source preparation procedure exists and is up-to-date >> ..." >> (procedure "adp_prepare" line 2) >> invoked from within >> "adp_prepare" >> invoked from within >> "template::adp_parse $themed_template {}" >> (procedure "adp_parse_ad_conn_file" line 14) >> invoked from within >> "$handler" >> ("uplevel" body line 2) >> invoked from within >> "uplevel $code" >> invoked from within >> "ad_try { >> $handler >> } ad_script_abort val { >> # do nothing >> }" >> invoked from within >> "rp_serve_concrete_file [ad_conn file]" >> (procedure "::nsf::procs::rp_serve_abstract_file" line 60) >> invoked from within >> "rp_serve_abstract_file "$root/$extra_url"" >> ("uplevel" body line 2) >> invoked from within >> >> >>> On Dhuʻl-Q. 20, 1441 AH, at 21:14, Iuri de Araujo Sampaio <iu...@iu... <mailto:iu...@iu...>> wrote: >>> >>> Hi there, >>> >>> My code's intended to open a websocket connection to the echo service, wait 400ms to ensure that the connection is really established and send a textual message, which should be echoed back by the echo service. >>> >>> The last part will be handling/parsing that message (i.e. TXT or JSON message, which was echoed in that channel). Thus, every time a message comes through the channel a callback will be in charge to parse that message and store its content. >>> >>> 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. >>> How would refactor a "background websocket connection", using the new implementation available at: https://bitbucket.org/naviserver/websocket/src/master/ <https://bitbucket.org/naviserver/websocket/src/master/> ? >>> >>> Here it’s the code >>> >>> package require websocket >>> ::websocket::loglevel debug >>> proc handler { sock type msg } { >>> switch -glob -nocase -- $type { >>> co* { >>> ns_log Notice "Connected on $sock" >>> puts "Connected on $sock" >>> >>> } >>> te* { >>> ns_log Notice "RECEIVED $msg" >>> puts "RECEIVED: $msg" >>> } >>> cl* - >>> dis* { >>> } >>> } >>> >>> } >>> proc test { sock } { >>> puts "[::websocket::conninfo $sock type] from [::websocket::conninfo $sock sockname] to [::websocket::conninfo $sock peername]" >>> >>> ::websocket::send $sock text "Testing, testing..." >>> } >>> set sock [::websocket::open wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello> handler] >>> ns_log Notice "SOCKET \n $socket" >>> after 400 test $sock >>> vwait forever >>> >>> >>> >>> >>> Documentation Reference: https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1 <https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1> >>> >>> >>> Best wishes, >>> I >>> >>> >>> >>> >>> >>> >>> [11/Jul/2020:20:39:38][471.7efbf37fe700][-conn:iurix:0:91-] Error: can't set "formMap": variable is array >>> while executing >>> "variable formMap [array get map]" >>> (procedure "init" line 15) >>> invoked from within >>> "init" >>> (in namespace eval "::http" script line 83) >>> invoked from within >>> "namespace eval http { >>> # Allow resourcing to not clobber existing data >>> >>> variable http >>> if {![info exists http]} { >>> array set http { >>> -ac..." >>> (file "/usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" line 16) >>> invoked from within >>> "source -encoding utf-8 /usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" >>> ("package ifneeded http 2.9.0" script) >>> invoked from within >>> "package require http 2.7" >>> (file "/usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" line 20) >>> invoked from within >>> "source /usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" >>> ("package ifneeded websocket 1.4.1" script) >>> invoked from within >>> "package require websocket" >>> ("uplevel" body line 3) >>> invoked from within >>> "uplevel { >>> >>> package require websocket >>> ::websocket::loglevel debug >>> proc handler { sock type msg } { >>> switch -glob -nocase -- $type { >>> co* { >>> ..." >>> (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/ws2" line 2) >>> invoked from within >>> "code::tcl::$__adp_stub" >>> ("uplevel" body line 12) >>> invoked from within >>> "uplevel { >>> >>> if { [file exists $__adp_stub.tcl] } { >>> >>> # ensure that data source preparation procedure exists and is up-to-date >>> ..." >>> (procedure "adp_prepare" line 2) >>> invoked from within >>> "adp_prepare" >>> invoked from within >>> "template::adp_parse $themed_template {}" >>> (procedure "adp_parse_ad_conn_file" line 14) >>> invoked from within >>> "$handler" >>> ("uplevel" body line 2) >>> invoked from within >>> "uplevel $code" >>> invoked from within >>> "ad_try { >>> $handler >>> } ad_script_abort val { >>> # do nothing >>> }" >>> invoked from within >>> "rp_serve_concrete_file [ad_conn file]" >>> (procedure "::nsf::procs::rp_serve_abstract_file" line 60) >>> invoked from within >>> "rp_serve_abstract_file "$root/$extra_url"" >>> ("uplevel" body line 2) >>> invoked from within >>> "uplevel $code" >>> invoked from within >>> "ad_try { >>> rp_serve_abstract_file "$root/$extra_url" >>> set ::tcl_url2file([ad_conn url]) [ad_conn file] >>> se..." >>> called from rp_handler >>> GET http://iurix.com/websocket/ws2? <http://iurix.com/websocket/ws2?> referred by '' peer 192.199.241.135 user_id 0 >>> >>> Host: iurix.com <http://iurix.com/> >>> X-Real-IP: 179.199.201.237 >>> Connection: close >>> Upgrade-Insecure-Requests: 1 >>> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 >>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 >>> Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7 >>> Cookie: _ga=GA1.2.1048850939.1594336017; _gid=GA1.2.432393726.1594336018; mycrawler=-6040px%3A2521px%3Aleft; ad_session_id="44640008%2c0%2c0%2c1594507600%20{834%201594508800%20914BAD40D8EF86359761E4528028EE55857B5F51}" >>> >>> _______________________________________________ >>> naviserver-devel mailing list >>> nav...@li... <mailto:nav...@li...> >>> https://lists.sourceforge.net/lists/listinfo/naviserver-devel <https://lists.sourceforge.net/lists/listinfo/naviserver-devel> >> >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... <mailto:nav...@li...> >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Iuri de A. S. <iu...@iu...> - 2020-07-13 00:14:25
|
… I've hit “send” button by mistake…. Hi Gustaf I’ve noticed you had uploaded a simple client interface to websocket-procs.tcl. https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl <https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl> However, I hit another error related to [dict], because the url doesn’t return a path, when [dict get $d path] runs. The websocket sample is "wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello>”,which returns the following content [12/Jul/2020:21:10:09][22414.7efbf37fe700][-conn:iurix:0:9-] Notice: D proto wss host javascript.info path article/websocket/demo tail hello I’m going to continue writing this client. I don’t know if you are in the middle the implementation but I shall thank you in advance. That’s been very helpful already. Best wishes, I > On Dhuʻl-Q. 21, 1441 AH, at 21:08, Iuri de Araujo Sampaio <iu...@iu...> wrote: > > Hi Gustaf, > I’ve noticed you had uploaded a simple client interface to websocket-procs.tcl. > https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl <https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl> > > However, I hit another error related to [dict], because the url doesn’t return a path, when [dict get $d path] runs. > The websocket sample is "wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello>" > > Best wishes, > I > > > [12/Jul/2020:21:10:09][22414.7efbf37fe700][-conn:iurix:0:9-] Notice: D proto wss host javascript.info path article/websocket/demo tail hello > [12/Jul/2020:21:03:33][22342.7efbf37fe700][-conn:iurix:0:36-] Error: can't read "path": no such variable > while executing > "append request_url /$path" > (procedure "ws::client::open" line 19) > invoked from within > "ws::client::open $url" > ("uplevel" body line 8) > invoked from within > "uplevel { > ns_log Notice "Running TCL script luna.tcl" > > (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/luna" line 2) > invoked from within > "code::tcl::$__adp_stub" > ("uplevel" body line 12) > invoked from within > "uplevel { > > if { [file exists $__adp_stub.tcl] } { > > # ensure that data source preparation procedure exists and is up-to-date > ..." > (procedure "adp_prepare" line 2) > invoked from within > "adp_prepare" > invoked from within > "template::adp_parse $themed_template {}" > (procedure "adp_parse_ad_conn_file" line 14) > invoked from within > "$handler" > ("uplevel" body line 2) > invoked from within > "uplevel $code" > invoked from within > "ad_try { > $handler > } ad_script_abort val { > # do nothing > }" > invoked from within > "rp_serve_concrete_file [ad_conn file]" > (procedure "::nsf::procs::rp_serve_abstract_file" line 60) > invoked from within > "rp_serve_abstract_file "$root/$extra_url"" > ("uplevel" body line 2) > invoked from within > > >> On Dhuʻl-Q. 20, 1441 AH, at 21:14, Iuri de Araujo Sampaio <iu...@iu... <mailto:iu...@iu...>> wrote: >> >> Hi there, >> >> My code's intended to open a websocket connection to the echo service, wait 400ms to ensure that the connection is really established and send a textual message, which should be echoed back by the echo service. >> >> The last part will be handling/parsing that message (i.e. TXT or JSON message, which was echoed in that channel). Thus, every time a message comes through the channel a callback will be in charge to parse that message and store its content. >> >> 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. >> How would refactor a "background websocket connection", using the new implementation available at: https://bitbucket.org/naviserver/websocket/src/master/ <https://bitbucket.org/naviserver/websocket/src/master/> ? >> >> Here it’s the code >> >> package require websocket >> ::websocket::loglevel debug >> proc handler { sock type msg } { >> switch -glob -nocase -- $type { >> co* { >> ns_log Notice "Connected on $sock" >> puts "Connected on $sock" >> >> } >> te* { >> ns_log Notice "RECEIVED $msg" >> puts "RECEIVED: $msg" >> } >> cl* - >> dis* { >> } >> } >> >> } >> proc test { sock } { >> puts "[::websocket::conninfo $sock type] from [::websocket::conninfo $sock sockname] to [::websocket::conninfo $sock peername]" >> >> ::websocket::send $sock text "Testing, testing..." >> } >> set sock [::websocket::open wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello> handler] >> ns_log Notice "SOCKET \n $socket" >> after 400 test $sock >> vwait forever >> >> >> >> >> Documentation Reference: https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1 <https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1> >> >> >> Best wishes, >> I >> >> >> >> >> >> >> [11/Jul/2020:20:39:38][471.7efbf37fe700][-conn:iurix:0:91-] Error: can't set "formMap": variable is array >> while executing >> "variable formMap [array get map]" >> (procedure "init" line 15) >> invoked from within >> "init" >> (in namespace eval "::http" script line 83) >> invoked from within >> "namespace eval http { >> # Allow resourcing to not clobber existing data >> >> variable http >> if {![info exists http]} { >> array set http { >> -ac..." >> (file "/usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" line 16) >> invoked from within >> "source -encoding utf-8 /usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" >> ("package ifneeded http 2.9.0" script) >> invoked from within >> "package require http 2.7" >> (file "/usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" line 20) >> invoked from within >> "source /usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" >> ("package ifneeded websocket 1.4.1" script) >> invoked from within >> "package require websocket" >> ("uplevel" body line 3) >> invoked from within >> "uplevel { >> >> package require websocket >> ::websocket::loglevel debug >> proc handler { sock type msg } { >> switch -glob -nocase -- $type { >> co* { >> ..." >> (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/ws2" line 2) >> invoked from within >> "code::tcl::$__adp_stub" >> ("uplevel" body line 12) >> invoked from within >> "uplevel { >> >> if { [file exists $__adp_stub.tcl] } { >> >> # ensure that data source preparation procedure exists and is up-to-date >> ..." >> (procedure "adp_prepare" line 2) >> invoked from within >> "adp_prepare" >> invoked from within >> "template::adp_parse $themed_template {}" >> (procedure "adp_parse_ad_conn_file" line 14) >> invoked from within >> "$handler" >> ("uplevel" body line 2) >> invoked from within >> "uplevel $code" >> invoked from within >> "ad_try { >> $handler >> } ad_script_abort val { >> # do nothing >> }" >> invoked from within >> "rp_serve_concrete_file [ad_conn file]" >> (procedure "::nsf::procs::rp_serve_abstract_file" line 60) >> invoked from within >> "rp_serve_abstract_file "$root/$extra_url"" >> ("uplevel" body line 2) >> invoked from within >> "uplevel $code" >> invoked from within >> "ad_try { >> rp_serve_abstract_file "$root/$extra_url" >> set ::tcl_url2file([ad_conn url]) [ad_conn file] >> se..." >> called from rp_handler >> GET http://iurix.com/websocket/ws2? <http://iurix.com/websocket/ws2?> referred by '' peer 192.199.241.135 user_id 0 >> >> Host: iurix.com <http://iurix.com/> >> X-Real-IP: 179.199.201.237 >> Connection: close >> Upgrade-Insecure-Requests: 1 >> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 >> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 >> Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7 >> Cookie: _ga=GA1.2.1048850939.1594336017; _gid=GA1.2.432393726.1594336018; mycrawler=-6040px%3A2521px%3Aleft; ad_session_id="44640008%2c0%2c0%2c1594507600%20{834%201594508800%20914BAD40D8EF86359761E4528028EE55857B5F51}" >> >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... <mailto:nav...@li...> >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Iuri de A. S. <iu...@iu...> - 2020-07-13 00:08:45
|
Hi Gustaf, I’ve noticed you had uploaded a simple client interface to websocket-procs.tcl. https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl <https://bitbucket.org/naviserver/websocket/src/master/websocket-procs.tcl> However, I hit another error related to [dict], because the url doesn’t return a path, when [dict get $d path] runs. The websocket sample is "wss://javascript.info/article/websocket/demo/hello" Best wishes, I [12/Jul/2020:21:03:33][22342.7efbf37fe700][-conn:iurix:0:36-] Error: can't read "path": no such variable while executing "append request_url /$path" (procedure "ws::client::open" line 19) invoked from within "ws::client::open $url" ("uplevel" body line 8) invoked from within "uplevel { ns_log Notice "Running TCL script luna.tcl" #set url "ws://192.199.241.130:5008/api/subscribe?auth_token=9fb6e731-b342-4952-b0c1-aa1d0..." (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/luna" line 2) invoked from within "code::tcl::$__adp_stub" ("uplevel" body line 12) invoked from within "uplevel { if { [file exists $__adp_stub.tcl] } { # ensure that data source preparation procedure exists and is up-to-date ..." (procedure "adp_prepare" line 2) invoked from within "adp_prepare" invoked from within "template::adp_parse $themed_template {}" (procedure "adp_parse_ad_conn_file" line 14) invoked from within "$handler" ("uplevel" body line 2) invoked from within "uplevel $code" invoked from within "ad_try { $handler } ad_script_abort val { # do nothing }" invoked from within "rp_serve_concrete_file [ad_conn file]" (procedure "::nsf::procs::rp_serve_abstract_file" line 60) invoked from within "rp_serve_abstract_file "$root/$extra_url"" ("uplevel" body line 2) invoked from within > On Dhuʻl-Q. 20, 1441 AH, at 21:14, Iuri de Araujo Sampaio <iu...@iu...> wrote: > > Hi there, > > My code's intended to open a websocket connection to the echo service, wait 400ms to ensure that the connection is really established and send a textual message, which should be echoed back by the echo service. > > The last part will be handling/parsing that message (i.e. TXT or JSON message, which was echoed in that channel). Thus, every time a message comes through the channel a callback will be in charge to parse that message and store its content. > > 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. > How would refactor a "background websocket connection", using the new implementation available at: https://bitbucket.org/naviserver/websocket/src/master/ <https://bitbucket.org/naviserver/websocket/src/master/> ? > > Here it’s the code > > package require websocket > ::websocket::loglevel debug > proc handler { sock type msg } { > switch -glob -nocase -- $type { > co* { > ns_log Notice "Connected on $sock" > puts "Connected on $sock" > > } > te* { > ns_log Notice "RECEIVED $msg" > puts "RECEIVED: $msg" > } > cl* - > dis* { > } > } > > } > proc test { sock } { > puts "[::websocket::conninfo $sock type] from [::websocket::conninfo $sock sockname] to [::websocket::conninfo $sock peername]" > > ::websocket::send $sock text "Testing, testing..." > } > set sock [::websocket::open wss://javascript.info/article/websocket/demo/hello <wss://javascript.info/article/websocket/demo/hello> handler] > ns_log Notice "SOCKET \n $socket" > after 400 test $sock > vwait forever > > > > > Documentation Reference: https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1 <https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1> > > > Best wishes, > I > > > > > > > [11/Jul/2020:20:39:38][471.7efbf37fe700][-conn:iurix:0:91-] Error: can't set "formMap": variable is array > while executing > "variable formMap [array get map]" > (procedure "init" line 15) > invoked from within > "init" > (in namespace eval "::http" script line 83) > invoked from within > "namespace eval http { > # Allow resourcing to not clobber existing data > > variable http > if {![info exists http]} { > array set http { > -ac..." > (file "/usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" line 16) > invoked from within > "source -encoding utf-8 /usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" > ("package ifneeded http 2.9.0" script) > invoked from within > "package require http 2.7" > (file "/usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" line 20) > invoked from within > "source /usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" > ("package ifneeded websocket 1.4.1" script) > invoked from within > "package require websocket" > ("uplevel" body line 3) > invoked from within > "uplevel { > > package require websocket > ::websocket::loglevel debug > proc handler { sock type msg } { > switch -glob -nocase -- $type { > co* { > ..." > (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/ws2" line 2) > invoked from within > "code::tcl::$__adp_stub" > ("uplevel" body line 12) > invoked from within > "uplevel { > > if { [file exists $__adp_stub.tcl] } { > > # ensure that data source preparation procedure exists and is up-to-date > ..." > (procedure "adp_prepare" line 2) > invoked from within > "adp_prepare" > invoked from within > "template::adp_parse $themed_template {}" > (procedure "adp_parse_ad_conn_file" line 14) > invoked from within > "$handler" > ("uplevel" body line 2) > invoked from within > "uplevel $code" > invoked from within > "ad_try { > $handler > } ad_script_abort val { > # do nothing > }" > invoked from within > "rp_serve_concrete_file [ad_conn file]" > (procedure "::nsf::procs::rp_serve_abstract_file" line 60) > invoked from within > "rp_serve_abstract_file "$root/$extra_url"" > ("uplevel" body line 2) > invoked from within > "uplevel $code" > invoked from within > "ad_try { > rp_serve_abstract_file "$root/$extra_url" > set ::tcl_url2file([ad_conn url]) [ad_conn file] > se..." > called from rp_handler > GET http://iurix.com/websocket/ws2? <http://iurix.com/websocket/ws2?> referred by '' peer 192.199.241.135 user_id 0 > > Host: iurix.com <http://iurix.com/> > X-Real-IP: 179.199.201.237 > Connection: close > Upgrade-Insecure-Requests: 1 > User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 > Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7 > Cookie: _ga=GA1.2.1048850939.1594336017; _gid=GA1.2.432393726.1594336018; mycrawler=-6040px%3A2521px%3Aleft; ad_session_id="44640008%2c0%2c0%2c1594507600%20{834%201594508800%20914BAD40D8EF86359761E4528028EE55857B5F51}" > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Iuri de A. S. <iu...@iu...> - 2020-07-12 00:14:27
|
Hi there, My code's intended to open a websocket connection to the echo service, wait 400ms to ensure that the connection is really established and send a textual message, which should be echoed back by the echo service. The last part will be handling/parsing that message (i.e. TXT or JSON message, which was echoed in that channel). Thus, every time a message comes through the channel a callback will be in charge to parse that message and store its content. 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. How would refactor a "background websocket connection", using the new implementation available at: https://bitbucket.org/naviserver/websocket/src/master/ <https://bitbucket.org/naviserver/websocket/src/master/> ? Here it’s the code package require websocket ::websocket::loglevel debug proc handler { sock type msg } { switch -glob -nocase -- $type { co* { ns_log Notice "Connected on $sock" puts "Connected on $sock" } te* { ns_log Notice "RECEIVED $msg" puts "RECEIVED: $msg" } cl* - dis* { } } } proc test { sock } { puts "[::websocket::conninfo $sock type] from [::websocket::conninfo $sock sockname] to [::websocket::conninfo $sock peername]" ::websocket::send $sock text "Testing, testing..." } set sock [::websocket::open wss://javascript.info/article/websocket/demo/hello handler] ns_log Notice "SOCKET \n $socket" after 400 test $sock vwait forever Documentation Reference: https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1 <https://core.tcl-lang.org/tcllib/doc/tcllib-1-17/embedded/www/tcllib/files/modules/websocket/websocket.html#1> Best wishes, I [11/Jul/2020:20:39:38][471.7efbf37fe700][-conn:iurix:0:91-] Error: can't set "formMap": variable is array while executing "variable formMap [array get map]" (procedure "init" line 15) invoked from within "init" (in namespace eval "::http" script line 83) invoked from within "namespace eval http { # Allow resourcing to not clobber existing data variable http if {![info exists http]} { array set http { -ac..." (file "/usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" line 16) invoked from within "source -encoding utf-8 /usr/local/ns/lib/tcl8/8.6/http-2.9.0.tm" ("package ifneeded http 2.9.0" script) invoked from within "package require http 2.7" (file "/usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" line 20) invoked from within "source /usr/local/ns/lib/tcllib1.19/websocket/websocket.tcl" ("package ifneeded websocket 1.4.1" script) invoked from within "package require websocket" ("uplevel" body line 3) invoked from within "uplevel { package require websocket ::websocket::loglevel debug proc handler { sock type msg } { switch -glob -nocase -- $type { co* { ..." (procedure "code::tcl::/var/www/iurix//packages/ix-websocket/www/ws2" line 2) invoked from within "code::tcl::$__adp_stub" ("uplevel" body line 12) invoked from within "uplevel { if { [file exists $__adp_stub.tcl] } { # ensure that data source preparation procedure exists and is up-to-date ..." (procedure "adp_prepare" line 2) invoked from within "adp_prepare" invoked from within "template::adp_parse $themed_template {}" (procedure "adp_parse_ad_conn_file" line 14) invoked from within "$handler" ("uplevel" body line 2) invoked from within "uplevel $code" invoked from within "ad_try { $handler } ad_script_abort val { # do nothing }" invoked from within "rp_serve_concrete_file [ad_conn file]" (procedure "::nsf::procs::rp_serve_abstract_file" line 60) invoked from within "rp_serve_abstract_file "$root/$extra_url"" ("uplevel" body line 2) invoked from within "uplevel $code" invoked from within "ad_try { rp_serve_abstract_file "$root/$extra_url" set ::tcl_url2file([ad_conn url]) [ad_conn file] se..." called from rp_handler GET http://iurix.com/websocket/ws2? referred by '' peer 192.199.241.135 user_id 0 Host: iurix.com X-Real-IP: 179.199.201.237 Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: _ga=GA1.2.1048850939.1594336017; _gid=GA1.2.432393726.1594336018; mycrawler=-6040px%3A2521px%3Aleft; ad_session_id="44640008%2c0%2c0%2c1594507600%20{834%201594508800%20914BAD40D8EF86359761E4528028EE55857B5F51}" |
From: Maksym Z. <siq...@gm...> - 2020-07-08 15:33:23
|
Thank you, very much. I'm going to implement it right now. On Wed, Jul 8, 2020 at 2:29 PM Gustaf Neumann <ne...@wu...> wrote: > Dear Maksym, > > > So, for the time being, we have no such support in NaviServer. > > With the commit [1], i've added the first draft for server-side SNI > to NaviServer. It is not fully finished, but sufficiently stable > (already running on OpenACS.org) and should provide the > basic server-side support to supply and use per-virtual-server > certificates (see [1] for a configuration example). If possible > test this with your configuration. > > The known open items are listed below. > > all the best > > -g > > TODOs: > - add support for OCSP with SNI > - add support for Diffie Hellman with SNI > - add "ciphersuites" to ns_http > - add documentation for virtual hosting with nsssl > > [1] > > https://bitbucket.org/naviserver/naviserver/commits/4662b12c3c548db4b2d0ed6625c66260662d2089 > > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Gustaf N. <ne...@wu...> - 2020-07-08 15:29:48
|
Dear Maksym, > So, for the time being, we have no such support in NaviServer. With the commit [1], i've added the first draft for server-side SNI to NaviServer. It is not fully finished, but sufficiently stable (already running on OpenACS.org) and should provide the basic server-side support to supply and use per-virtual-server certificates (see [1] for a configuration example). If possible test this with your configuration. The known open items are listed below. all the best -g TODOs: - add support for OCSP with SNI - add support for Diffie Hellman with SNI - add "ciphersuites" to ns_http - add documentation for virtual hosting with nsssl [1] https://bitbucket.org/naviserver/naviserver/commits/4662b12c3c548db4b2d0ed6625c66260662d2089 |
From: Maksym Z. <siq...@gm...> - 2020-07-08 15:28:56
|
OMG, Gustaf you are amazing, I just saw last commit with SNI (Server Name Indication (SNI. Thank you On Sat, Jul 4, 2020 at 7:55 PM Gustaf Neumann <ne...@wu...> wrote: > > On 04.07.20 21:08, Maksym Zinchenko wrote: > > So now im facing this issues: > > 1) Some of the domains are not mine and belong to some clients, they > > might have their own certificates they bought. > > 2) Also I don't know how many clients I will have in the future, so > > everytime I add a new domain I need to regenerate multi-domain SAN > > cert (they are really expensive and I can't afford it) > > i see, i am having probably too much the letsencrypt world in mind. > > > I thought it was more simple like: > > 1) Load nsssl globally > > 2) Define "defaultserver" and certificate for this "defaultserver" > > 3) Define different certificates for each domain in ns_section > > "ns/server/${server}/module/nsssl > You want probably all these virtual servers listening on the same port > (if not, just load multiple drivers for different ports). > > With the single port, there is a chicken-egg problem: the right certificate > is needed at the time the connection is opened, and the virtual server can > be only detected while reading the request header. > > This is a well known problem, for which the SNI TLS extension was invented > (a hostname that can be used for identifying the certificate is passed > during the TLS handshake as well). Currently, NaviServer supports SNI only > at the client side (in ns_http), but not at the server side. It is not > overly > complicated to implemented this, but not trivial either, and will take > some effort. > > So, for the time being, we have no such support in NaviServer. > > all the best > -gn > > [1] https://en.wikipedia.org/wiki/Server_Name_Indication > > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Gustaf N. <ne...@wu...> - 2020-07-04 20:54:48
|
On 04.07.20 21:08, Maksym Zinchenko wrote: > So now im facing this issues: > 1) Some of the domains are not mine and belong to some clients, they > might have their own certificates they bought. > 2) Also I don't know how many clients I will have in the future, so > everytime I add a new domain I need to regenerate multi-domain SAN > cert (they are really expensive and I can't afford it) i see, i am having probably too much the letsencrypt world in mind. > I thought it was more simple like: > 1) Load nsssl globally > 2) Define "defaultserver" and certificate for this "defaultserver" > 3) Define different certificates for each domain in ns_section > "ns/server/${server}/module/nsssl You want probably all these virtual servers listening on the same port (if not, just load multiple drivers for different ports). With the single port, there is a chicken-egg problem: the right certificate is needed at the time the connection is opened, and the virtual server can be only detected while reading the request header. This is a well known problem, for which the SNI TLS extension was invented (a hostname that can be used for identifying the certificate is passed during the TLS handshake as well). Currently, NaviServer supports SNI only at the client side (in ns_http), but not at the server side. It is not overly complicated to implemented this, but not trivial either, and will take some effort. So, for the time being, we have no such support in NaviServer. all the best -gn [1] https://en.wikipedia.org/wiki/Server_Name_Indication |
From: Maksym Z. <siq...@gm...> - 2020-07-04 19:08:54
|
Dear Gustaf, my main problem is certificate. Loading the drivers globally works. When I access domains they are pointing and working correctly. The problem is nsssl when loaded globally must have "ns_param certificate", I misunderstood this parameter. I thought its like "ns_param defaultserver", like this "default certificate" will be used to connect to defaultserver, not like "this certificate" will be used to connect to all servers. So now im facing this issues: 1) Some of the domains are not mine and belong to some clients, they might have their own certificates they bought. 2) Also I don't know how many clients I will have in the future, so everytime I add a new domain I need to regenerate multi-domain SAN cert (they are really expensive and I can't afford it) I thought it was more simple like: 1) Load nsssl globally 2) Define "defaultserver" and certificate for this "defaultserver" 3) Define different certificates for each domain in ns_section "ns/server/${server}/module/nsssl I hope my explanation makes sense. Cheers, Maksym On Sat, Jul 4, 2020 at 4:32 PM Gustaf Neumann <ne...@wu...> wrote: > Dear Maksym, > > If you are using virtual host, you should load the drivers globally > and - when connect via https - use multi-domain SAN certificates > (as produced e.g. by [1]). > > openacs.org is a configuration using (a) multiple names for the > same server (such as .org, .net, with and without "www." prefix), > and (b) uses virtual hosts to redirect requests to different servers > (e.g. https://dotlrn.org/, https://cvs.openacs.org/, http://xotcl.org/) > > it has essentially two global drivers, where both drivers > have multiple IP addresses assigned: > > set address "137.208.116.31 2001:628:404:74::31" > > The essential part of the log file is below (pasted together). > Below this is the definition of the xotcl.org website. > > Does this help? > > -gn > > > ====== > set server "openacs.org" > # ... > > ns_section ns/module/nsssl/servers > ns_param $server $server > ns_param $server www.openacs.net > ns_param $server www.openacs.org > ns_param $server www.openacs.com > ns_param $server openacs.net > ns_param $server openacs.com > ns_param $server openacs.wu.ac.at > ns_param $server openacs.wu-wien.ac.at > ns_param $server smtp.openacs.org > ns_param dotlrn dotlrn.org > ns_param dotlrn dotlrn.net > ns_param dotlrn dotlrn.com > ns_param dotlrn www.dotlrn.com > ns_param dotlrn www.dotlrn.org > ns_param cvs fisheye.openacs.org > ns_param cvs cvs.openacs.org > > ns_section ns/module/nssock/servers > ns_param $server $server > ns_param $server www.openacs.net > ns_param $server www.openacs.org > ns_param $server www.openacs.com > ns_param $server openacs.net > ns_param $server openacs.com > ns_param $server openacs.wu.ac.at > ns_param $server openacs.wu-wien.ac.at > ns_param $server smtp.openacs.org > ns_param dotlrn dotlrn.org > ns_param dotlrn dotlrn.net > ns_param dotlrn dotlrn.com > ns_param dotlrn www.dotlrn.com > ns_param dotlrn www.dotlrn.org > ns_param dotlrn www.dotlrn.net > ns_param cvs fisheye.openacs.org > ns_param cvs cvs.openacs.org > ns_param xotcl xotcl.org > ns_param xotcl www.xotcl.org > ====== > > > ====== > ######################################################################## > # XOTcl.org > ######################################################################## > ns_section "ns/servers" > ns_param xotcl "Old XOTcl Web Site" > > ns_section ns/module/nssock/servers > ns_param xotcl xotcl.org > ns_param xotcl www.xotcl.org > > ns_section ns/server/xotcl > ns_param minthreads 2 > > ns_section "ns/server/xotcl/tcl" > ns_param library /home/xotcl/www.xotcl.org/naviserver > ====== > > > [1] https://bitbucket.org/naviserver/letsencrypt/src/master/ > On 04.07.20 13:54, Maksym Zinchenko wrote: > > Hello, I'm trying to set up host based virtual hosts with naviserver but I > can't understand it easily or correctly. so what i'm trying to accomplish: > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Iuri de A. S. <iu...@iu...> - 2020-07-04 17:43:54
|
Indeed! In fact, A.I. has been playing a big role in this field already (i.e. self-healing). We could bring into TCL’s world! Most of the time I get lazy, skipping test-cases, going directly to debug without planing and writing unit tests, then I miss the opportunity to get a better perspective of the implementation. That, I’d call it as "self-sabotage”. As It could save me a lot of time and headaches, debugging codes. Best wishes, I > On Jul 4, 2020, at 14:10, Gustaf Neumann <ne...@wu...> wrote: > > Maybe, we should add "self-healing" to the feature list of NaviServer :) > > In general, it is a good idea to make test-cases with curl, also for you to understand, what is going on in detail. > > all the best > > -gn > > On 04.07.20 18:37, Iuri de Araujo Sampaio wrote: >> Hi, >> I woke up today and Postman requests work fine now. I have no clue what the error was, and I have done nothing to fix it. >> >> Well, I added a log message in the first line, before calling [ns_getform], but that would no affect the problem. Maybe the stars were playing with me last night. Or it was a cache refreshing delay. Who knows? kkkkk >> >> ns_log Notice "CTree $cTree ****" >> >> Best wishes, >> I >> >> >> >>> On Jul 4, 2020, at 00:25, Iuri de Araujo Sampaio <iu...@iu... <mailto:iu...@iu...>> wrote: >>> >>> Hello there, >>> >>> Reading [ns_getform] documentation, I noticed it supports multipart/form-data >>> https://naviserver.sourceforge.io/n/naviserver/files/ns_getform.html <https://naviserver.sourceforge.io/n/naviserver/files/ns_getform.html> >>> >>> However, when I run the chunk bellow, it shows no form, neither fields and values at all, in the GET request. >>> >>> I’ve written [ns_getcontent …] right bellow the chunk, confirming that the body of the request has content within it, plus in the proper format (i.e. multipart/form-data). >>> >>> Furthermore, if I switch the request to application/x-www-form-urlencoded the chunk works just fine and form fields are properly assigned. Thus, I’m lost! >>> >>> Could it be that Postman uses a different format for form-data? (Thus, it isn’t supported by ns_getform.) >>> >>> Logs are bellow. >>> >>> Best wishes. >>> I >>> >>> >>> set myform [ns_getform] >>> if {[string equal "" $myform]} { >>> ns_log Notice "No Form was submited" >>> } else { >>> ns_log Notice "FORM" >>> ns_set print $myform >>> for {set i 0} {$i < [ns_set size $myform]} {incr i} { >>> set varname [ns_set key $myform $i] >>> set varvalue [ns_set value $myform $i] >>> >>> ns_log Notice " $varname - $varvalue" >>> } >>> } >>> >>> ns_log Notice "BODY \n [ns_getcontent -as_file false]” >>> >>> >>> >>> >>> >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: HEADER >>> t0 >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: HEADERS 11 >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: Host iurix.com <http://iurix.com/> X-Real-IP 179.199.203.207 Connection close Content-Length 386 authorization {Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eydzdWInOiAnNTk0MycsICdpYXQnOiAxNTkzODI2NjQ0fQ==.20f471933ae0a9c58d525f4ab0c1eef7adab03f17c3bbe18a00cf30a1ef06948} User-Agent PostmanRuntime/7.25.0 Accept */* Cache-Control no-cache Postman-Token 93e1f2b8-b680-470f-be60-52a25c93db0a Content-Type {multipart/form-data; boundary=--------------------------973675580213918217977892} Cookie ad_session_id=\"35550042%2c0%2c0%2c1593831987%20{947%201593833187%20876F0016C8883111AC63B5C6B6D964D76ED2D1DF}\" >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: FORM >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: BODY >>> ----------------------------973675580213918217977892 >>> Content-Disposition: form-data; name="cTree" >>> >>> featured >>> ----------------------------973675580213918217977892 >>> Content-Disposition: form-data; name="cTreeName" >>> >>> t >>> ----------------------------973675580213918217977892 >>> Content-Disposition: form-data; name="cTreeIcon" >>> >>> t >>> ----------------------------973675580213918217977892-- >>> >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: TREE >>> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: cTree >>> _______________________________________________ >>> naviserver-devel mailing list >>> nav...@li... <mailto:nav...@li...> >>> https://lists.sourceforge.net/lists/listinfo/naviserver-devel <https://lists.sourceforge.net/lists/listinfo/naviserver-devel> >> >> >> >> >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... <mailto:nav...@li...> >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel <https://lists.sourceforge.net/lists/listinfo/naviserver-devel> > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Gustaf N. <ne...@wu...> - 2020-07-04 17:32:15
|
Dear Maksym, If you are using virtual host, you should load the drivers globally and - when connect via https - use multi-domain SAN certificates (as produced e.g. by [1]). openacs.org is a configuration using (a) multiple names for the same server (such as .org, .net, with and without "www." prefix), and (b) uses virtual hosts to redirect requests to different servers (e.g. https://dotlrn.org/, https://cvs.openacs.org/, http://xotcl.org/) it has essentially two global drivers, where both drivers have multiple IP addresses assigned: set address "137.208.116.31 2001:628:404:74::31" The essential part of the log file is below (pasted together). Below this is the definition of the xotcl.org website. Does this help? -gn ====== set server "openacs.org" # ... ns_section ns/module/nsssl/servers ns_param $server $server ns_param $server www.openacs.net ns_param $server www.openacs.org ns_param $server www.openacs.com ns_param $server openacs.net ns_param $server openacs.com ns_param $server openacs.wu.ac.at ns_param $server openacs.wu-wien.ac.at ns_param $server smtp.openacs.org ns_param dotlrn dotlrn.org ns_param dotlrn dotlrn.net ns_param dotlrn dotlrn.com ns_param dotlrn www.dotlrn.com ns_param dotlrn www.dotlrn.org ns_param cvs fisheye.openacs.org ns_param cvs cvs.openacs.org ns_section ns/module/nssock/servers ns_param $server $server ns_param $server www.openacs.net ns_param $server www.openacs.org ns_param $server www.openacs.com ns_param $server openacs.net ns_param $server openacs.com ns_param $server openacs.wu.ac.at ns_param $server openacs.wu-wien.ac.at ns_param $server smtp.openacs.org ns_param dotlrn dotlrn.org ns_param dotlrn dotlrn.net ns_param dotlrn dotlrn.com ns_param dotlrn www.dotlrn.com ns_param dotlrn www.dotlrn.org ns_param dotlrn www.dotlrn.net ns_param cvs fisheye.openacs.org ns_param cvs cvs.openacs.org ns_param xotcl xotcl.org ns_param xotcl www.xotcl.org ====== ====== ######################################################################## # XOTcl.org ######################################################################## ns_section "ns/servers" ns_param xotcl "Old XOTcl Web Site" ns_section ns/module/nssock/servers ns_param xotcl xotcl.org ns_param xotcl www.xotcl.org ns_section ns/server/xotcl ns_param minthreads 2 ns_section "ns/server/xotcl/tcl" ns_param library /home/xotcl/www.xotcl.org/naviserver ====== [1] https://bitbucket.org/naviserver/letsencrypt/src/master/ On 04.07.20 13:54, Maksym Zinchenko wrote: > Hello, I'm trying to set up host based virtual hosts with naviserver > but I can't understand it easily or correctly. so what i'm trying to > accomplish: > |
From: Gustaf N. <ne...@wu...> - 2020-07-04 17:11:16
|
Maybe, we should add "self-healing" to the feature list of NaviServer :) In general, it is a good idea to make test-cases with curl, also for you to understand, what is going on in detail. all the best -gn On 04.07.20 18:37, Iuri de Araujo Sampaio wrote: > Hi, > I woke up today and Postman requests work fine now. I have no clue > what the error was, and I have done nothing to fix it. > > Well, I added a log message in the first line, before calling > [ns_getform], but that would no affect the problem. Maybe the stars > were playing with me last night. Or it was a cache refreshing delay. > Who knows? kkkkk > > ns_log Notice "CTree $cTree ****" > > Best wishes, > I > > >> On Jul 4, 2020, at 00:25, Iuri de Araujo Sampaio <iu...@iu... >> <mailto:iu...@iu...>> wrote: >> >> Hello there, >> >> Reading [ns_getform] documentation, I noticed it supports >> multipart/form-data >> https://naviserver.sourceforge.io/n/naviserver/files/ns_getform.html >> >> However, when I run the chunk bellow, it shows no form, neither >> fields and values at all, in the GET request. >> >> I’ve written [ns_getcontent …] right bellow the chunk, confirming >> that the body of the request has content within it, plus in the >> proper format (i.e. multipart/form-data). >> >> Furthermore, if I switch the request to >> /application/x-www-form-urlencoded/the chunk works just fine and form >> fields are properly assigned. Thus, I’m lost! >> >> Could it be that Postman uses a different format for form-data? >> (Thus, it isn’t supported by ns_getform.) >> >> Logs are bellow. >> >> Best wishes. >> I >> >> >> setmyform[ns_getform] >> if{[stringequal ""$myform]} { >> ns_log Notice "No Form was submited" >> } else{ >> ns_log Notice "FORM" >> ns_set print $myform >> for{seti 0} {$i< [ns_set size $myform]} {incri} { >> setvarname[ns_set key $myform$i] >> setvarvalue[ns_set value $myform$i] >> >> ns_log Notice " $varname - $varvalue" >> } >> } >> >> ns_log Notice "BODY \n [ns_getcontent -as_file false]” >> >> >> >> >> >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: HEADER >> t0 >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: HEADERS 11 >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: Host iurix.com <http://iurix.com/> X-Real-IP 179.199.203.207 >> Connection close Content-Length 386 authorization {Bearer >> eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eydzdWInOiAnNTk0MycsICdpYXQnOiAxNTkzODI2NjQ0fQ==.20f471933ae0a9c58d525f4ab0c1eef7adab03f17c3bbe18a00cf30a1ef06948} >> User-Agent PostmanRuntime/7.25.0 Accept */* Cache-Control no-cache >> Postman-Token 93e1f2b8-b680-470f-be60-52a25c93db0a Content-Type >> {multipart/form-data; >> boundary=--------------------------973675580213918217977892} Cookie >> ad_session_id=\"35550042%2c0%2c0%2c1593831987%20{947%201593833187%20876F0016C8883111AC63B5C6B6D964D76ED2D1DF}\" >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: FORM >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: BODY >> ----------------------------973675580213918217977892 >> Content-Disposition: form-data; name="cTree" >> >> featured >> ----------------------------973675580213918217977892 >> Content-Disposition: form-data; name="cTreeName" >> >> t >> ----------------------------973675580213918217977892 >> Content-Disposition: form-data; name="cTreeIcon" >> >> t >> ----------------------------973675580213918217977892-- >> >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: TREE >> [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] >> Notice: cTree >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... >> <mailto:nav...@li...> >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel > > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Iuri de A. S. <iu...@iu...> - 2020-07-04 16:52:31
|
Hi, I woke up today and Postman requests work fine now. I have no clue what the error was, and I have done nothing to fix it. Well, I added a log message in the first line, before calling [ns_getform], but that would no affect the problem. Maybe the stars were playing with me last night. Or it was a cache refreshing delay. Who knows? kkkkk ns_log Notice "CTree $cTree ****" Best wishes, I > On Jul 4, 2020, at 00:25, Iuri de Araujo Sampaio <iu...@iu...> wrote: > > Hello there, > > Reading [ns_getform] documentation, I noticed it supports multipart/form-data > https://naviserver.sourceforge.io/n/naviserver/files/ns_getform.html <https://naviserver.sourceforge.io/n/naviserver/files/ns_getform.html> > > However, when I run the chunk bellow, it shows no form, neither fields and values at all, in the GET request. > > I’ve written [ns_getcontent …] right bellow the chunk, confirming that the body of the request has content within it, plus in the proper format (i.e. multipart/form-data). > > Furthermore, if I switch the request to application/x-www-form-urlencoded the chunk works just fine and form fields are properly assigned. Thus, I’m lost! > > Could it be that Postman uses a different format for form-data? (Thus, it isn’t supported by ns_getform.) > > Logs are bellow. > > Best wishes. > I > > > set myform [ns_getform] > if {[string equal "" $myform]} { > ns_log Notice "No Form was submited" > } else { > ns_log Notice "FORM" > ns_set print $myform > for {set i 0} {$i < [ns_set size $myform]} {incr i} { > set varname [ns_set key $myform $i] > set varvalue [ns_set value $myform $i] > > ns_log Notice " $varname - $varvalue" > } > } > > ns_log Notice "BODY \n [ns_getcontent -as_file false]” > > > > > > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: HEADER > t0 > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: HEADERS 11 > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: Host iurix.com <http://iurix.com/> X-Real-IP 179.199.203.207 Connection close Content-Length 386 authorization {Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eydzdWInOiAnNTk0MycsICdpYXQnOiAxNTkzODI2NjQ0fQ==.20f471933ae0a9c58d525f4ab0c1eef7adab03f17c3bbe18a00cf30a1ef06948} User-Agent PostmanRuntime/7.25.0 Accept */* Cache-Control no-cache Postman-Token 93e1f2b8-b680-470f-be60-52a25c93db0a Content-Type {multipart/form-data; boundary=--------------------------973675580213918217977892} Cookie ad_session_id=\"35550042%2c0%2c0%2c1593831987%20{947%201593833187%20876F0016C8883111AC63B5C6B6D964D76ED2D1DF}\" > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: FORM > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: BODY > ----------------------------973675580213918217977892 > Content-Disposition: form-data; name="cTree" > > featured > ----------------------------973675580213918217977892 > Content-Disposition: form-data; name="cTreeName" > > t > ----------------------------973675580213918217977892 > Content-Disposition: form-data; name="cTreeIcon" > > t > ----------------------------973675580213918217977892-- > > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: TREE > [04/Jul/2020:00:07:19][8773.7efbf2d6e700][-conn:iurix:1:1031-] Notice: cTree > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Maksym Z. <siq...@gm...> - 2020-07-04 11:55:09
|
Hello, I'm trying to set up host based virtual hosts with naviserver but I can't understand it easily or correctly. so what i'm trying to accomplish: I have one big dedicated server, and i'm moving all my VPS's to it. So Ive created the main config file /opt/ns/conf/dz_nsd.tcl, subdirectory/opt/ns/conf/ servers. In dz_nsd.tcl I have this lines: >set servers [glob -directory [file join /opt/ns/conf/ servers] *] >ns_section "ns/servers" { >foreach server $servers { >ns_param [file tail $server] "[file tail $server]" >} >} >ns_section "ns/module/nsssl/servers" { >foreach server $servers { >ns_param [file tail $server] [file tail $server] >} >} >ns_section "ns/module/nssock/servers" { >foreach server $servers { >ns_param [file tail $server] [file tail $server] >} >} In the server directory I have files in format: domain_name.com, domain_name.org, domain_name.net. Basically its 1 template file where I have defined pageroot, servername, db pools and other configurations specific to this server. According to manual nsssl module is loaded per server, so i'm doing it in my files in server directory: >ns_section ns/server/${server}/modules { >ns_param nsssl nsssl.so >} And loading a certificate: >ns_section ns/server/${server}/module/nsssl { >ns_param certificate /opt/ns/modules/nsssl/${server}.pem >.... >} What I'm trying to accomplish with this: 1) If i need a new server, just copy my server template, change name to domain_name, set server var inside to domain name and drop it in server directory. 2) Get a certificate for domain place it in modules/nsssl/${domain_name}.pem 3) Restart naviserver and voilà! The problem is when I'm trying to access my domains they all go to the same domain. Doesn't matter what im trying to access domain_name.com, domain_name.org, domain_name.net all goes to domain_name.com Would be so kind to tell me what I'm doing wrong? |