r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Terry
12-Jan-2010
[7458x4]
Ok got it.. the problem was this..  I have two fields, and to test, 
i only filled out one... so the string looked like so.. "[one 'on' 
two '']"  (where the value following two is a pair of single quotes)
So when i converted to a block, I got an INVALID WORD --'' error.

But, using sockets, the error isn't reported... In other words, debugging 
is a pain.
Last issue is this.. 
n: [ one 'on' two 'tw']
n/one is returning
on'  
(note the apos) 
What's up with that??
nevermind
I am a little concerned.. My entire cheyenne directory is rapidly 
approaching 2.5mb.
BrianH
12-Jan-2010
[7462x2]
That is horrifically large by REBOL standards, but not bad by web 
standards. How much is images and other web stuff?
As opposed to RSP and Cheyenne files, I mean.
Terry
12-Jan-2010
[7464x3]
probably about 2/3rds :)
That includes all the Atom db functions and data
Jison: An API for creating parsers in JavaScript
http://tinyurl.com/yeravlz
Dockimbel
12-Jan-2010
[7467]
Terry, there's a Javascript group for such topics.
Terry
13-Jan-2010
[7468x5]
Hey Doc, refreshing the page after every change to a ws-app is painful. 
 Can't we just DO a script using do-task/on-done, put some error 
checking on the front end? So that the ws-app is just a handler of 
sorts as well.

could then set up a timer/schduler.. and makes changes live.. that 
would  make script development 10x faster. 
Refreshing to reload ws app is like a compiler.
This works in answer to my last questions.. 

	on-message: func [client data][
		;-- escape all html tags for security concerns
		data: copy data
		replace/all data "<" "&lt;"
		replace/all data ">" "&gt;"

		params: load copy data  
			
		do-task/on-done data func [client data][
		 n: do load %test2.r
		 broadcast out
		]
	]
test2.r looks like this;

print params/1
out: "alert('ok');"
Now i can edit the test2.r script at will .  Im guessing this is 
still non-blocking?
Here's a better version.. with basic error notification;

	on-message: func [client data][
		;-- escape all html tags for security concerns
		data: copy data
		replace/all data "<" "&lt;"
		replace/all data ">" "&gt;"

		params: load copy data  
			
		do-task/on-done data func [client data][

   if error? try[do load %test2.r][out: "alert('error with test2.r');"]
		 broadcast out
		]
	]
Graham
13-Jan-2010
[7473x2]
why have you got 

data: copy data
and then load copy data ?
how many copies do you need?
Terry
13-Jan-2010
[7475x6]
to lazy to clean it up
The "load copy data" was last nights work.. didn't care too much 
about anything else..
Here's an example piece of JS that passes the params to this ws-app


<button onclick="ws.send('[{sofpandv} {} {isa} {person}]');return 
false;">GO</button>
If you want to pull the value of a field for the first param.. 

<button onclick="ws.send('[{'+ $("#elementid).val(); +'} {} {isa} 
{person}]');return false;">GO</button>
Very simple, very cool.
What we need now is a JQuery dialect for scripting the DOM.. never 
needed to pass back JSON, but push well formed JS
Carl
13-Jan-2010
[7481]
Do must people run cheyenne from source or from its encap?
Graham
13-Jan-2010
[7482x2]
I ran my own encap version as I needed /command
and I didn't think the command license permitted me to run command 
on multiple servers
Carl
13-Jan-2010
[7484]
why not?
Graham
13-Jan-2010
[7485]
Irrelevant now
Carl
13-Jan-2010
[7486]
strange... this box runs this altme world, but not cheyenne.
Graham
13-Jan-2010
[7487]
meaning cheyenne won't run?
Carl
13-Jan-2010
[7488x3]
no, it's running. just no access
I see 8 instances of itself.  Is there some kind of setup required?
perhaps I need to uncomment the listen line in the config?
Graham
13-Jan-2010
[7491x6]
it defaults to port 80 ...
8 instances sounds right .. those are the worker processes
You only need the listen line if you are listening on a different 
port ... but did you install Apache ?
ie, did the distro you chose include Apache ...
anyway, you could try listening on a higher port and see if it works 
..
I know Henrik is using Linode and Cheyenne
Carl
13-Jan-2010
[7497]
no apache
Graham
13-Jan-2010
[7498]
firewall?
Carl
13-Jan-2010
[7499]
thinking.... does it need to run as root?
Graham
13-Jan-2010
[7500x2]
does wget work on localhost?
I've usually started cheyenne as root ...
Carl
13-Jan-2010
[7502x3]
there is no wget
read http://localhostfails
It's interesting... my browser hangs on it... so it's like it's not 
sending the http header to get things going.
Graham
13-Jan-2010
[7505]
I guess try root ...
Carl
13-Jan-2010
[7506x2]
must be a config problem. checking
tried 8000 too