World: r3wp
[!Cheyenne] Discussions about the Cheyenne Web Server
older newer | first last |
Endo 26-Jul-2010 [8573] | I write the pick function to return none if an error occurs. whole the function is inside an attempt pick port 1 ;--> none first port ;--> still return error but "first port" actually same with "pick port 1", it calls "pick", how it returns error? |
Graham 26-Jul-2010 [8574] | I can't read unformatted source code .. .but isn't your pick missing an integer parameter?s |
Endo 26-Jul-2010 [8575] | yes when I paste it to the forum, all formatting goes out.. in http protocol scheme, pick takes just one argument, port. |
Graham 26-Jul-2010 [8576x2] | Really?? |
Never noticed ... let me look | |
Endo 26-Jul-2010 [8578x2] | p: open ws://localhost/test pick p 1 ;if no data returns none first p ;if no data returns error (but it calls pick??) |
oops, sorry, there is no "pick" in http. it is in ftp. | |
Graham 26-Jul-2010 [8580] | heh .. I was looking and looking and trying to find new glasses ...! |
Endo 26-Jul-2010 [8581] | in pop scheme also, document says: "Read the Nth message from the POP port" but pick function takes just port as an argument. |
Graham 26-Jul-2010 [8582x2] | I think that's because the docs are wrong |
It only allows you to pick the first message ... so that's why it ignores the integer parameter | |
Endo 26-Jul-2010 [8584x2] | no, it works, and the pick function is (in pop) pick: func [ "Read the Nth message from the POP port" port ][ read-message port 1 ] |
oh yes. but it works in my ws scheme. | |
Graham 26-Jul-2010 [8586x2] | well, I don't have a pop account to test it now |
but the source there says to read the first message ... not the nth | |
Endo 26-Jul-2010 [8588x2] | I put my ws protocol here http://www.moldibi.com/download/ws.txt |
I confused because, first p simply calls pick, my pick function inside an attempt block, so it cannot return an error. but "first port" returns an error, if no data. its not a big deal. but spent some hours on it, then I saw that "pick port 1" returns none instead of error (as expected) So I don't know what is different between "first port" and "pick port 1" | |
Graham 26-Jul-2010 [8590] | I don't understand your question ... |
Endo 26-Jul-2010 [8591x2] | anyway, not a big problem. |
ws protocol works, run the chat server (see the post on the forum) p: open ws://localhost/chat insert p "hello" pick p 1 == "hello" insert p "/nick endo" pick p 1 == "server: you known as endo" | |
Graham 26-Jul-2010 [8593] | and pick p 1000000 is the same? |
Endo 26-Jul-2010 [8594] | I guess so :) |
Graham 26-Jul-2010 [8595] | some ports a pick is a bit meaningless |
Endo 26-Jul-2010 [8596x4] | yes, you can use only pick port 1. |
if no data, then it returns none, so you can simply poll it. it doesn't wait for the data. | |
ws protocol is event based in its specification, so made it as no-wait. then and event based protocol can be built on this. | |
syntax highlighted version http://www.moldibi.com/rebol/ws.html | |
Graham 26-Jul-2010 [8600] | net-utils/net-install ws self 80 |
NickA 27-Jul-2010 [8601x2] | Endo, for the moment, use 4 spaces for tabs, and you're formatting will stay intact. I'll change the script to replace tabs with spaces. |
Endo, I updated to script to maintain formatting in a few new ways :) | |
Endo 27-Jul-2010 [8603] | Thank you Nick. |
Graham 27-Jul-2010 [8604x3] | I know you can run virtual sites on the same port .. but do things work better if you run an instance of Cheyenne for each site ( using a different port ) ?? |
At present I have to manually edit the httpd.cfg and restart ( maybe reloading works ) Cheyenne when I add a new user. | |
I'm wonding if I can just create a new httpd.cfg from a template, make the changes to support the port I want to provision, create a sym link in the new directory and then run from the sym link... | |
Janko 27-Jul-2010 [8607] | Graham: why do you need to edit httpd.cfg for each user? |
Kaj 27-Jul-2010 [8608x3] | Also, you can reload the configuration without restarting Cheyenne |
The Syllable Server manual has an example how to do that on Linux: | |
http://web.syllable.org/Server/README-SyllableServer.txt | |
Graham 27-Jul-2010 [8611x3] | Janko, because each user has their own domain |
Is there an equivalent for kill on Win32 ? | |
I was thnking of using a web socket connection to cause Cheyenne to reload its configuration | |
Janko 27-Jul-2010 [8614] | Graham: domain or maybe subdomain? if subdomain and maybe domain also you could probably put nginx in front of cheyenne and use rewrite rules to do this (depending on the concrete situation) |
Graham 27-Jul-2010 [8615x3] | Domain ... not subdomain |
Maybe that's what I should have done in the first place ... used sub domains :( | |
And that way I wouldn't have all the issues of mismatched ssl certificates | |
Janko 27-Jul-2010 [8618x3] | for subdomains it's simple (and much cheaper than domains, since you don't have to buy each one) .. you use rewrite rules and modify domain to a get parameter that cheyenne can act on |
I think so called wildcard certificate work on all subdomains | |
I mean, you buy one for all subdomains | |
Graham 27-Jul-2010 [8621x2] | I don't buy the domains ..the users do :) |
I don't have that many users .. .so maybe I should start again ... | |
older newer | first last |