http://freenode.net/using_the_network.shtml
Best regards,
Rui Lopes
Count me in as a big fan of the project, but although Michael says on
the Orbited blog that 0.6.0 is about reliability rather than new
features, it looks as though it has been necessary to change it to the
extent that it breaks the documentation and examples on
http://www.orbited.org/. Right now, as an Orbited user rather than an
Orbited developer, that's making the transition a bit tricky. From what
I can tell:
- I cannot instantiate TCPSocket directly, and I cannot supply
Orbited.TCPSocket with arguments like host and port.
- there's a new syntax for the [access] section of the config file
- when I figure which way's up and which way is down in 0.6, I should be
able to open and close TCP connections at will (which I could not get
right in the 0.5 version I was using). But that's not documented at all,
I think.
Are my allegations correct? I'm happy to be wrong :)
Cheers,
Ben
Ben Weiner wrote:
> features, it looks as though it has been necessary to change it to the
> extent that it breaks the documentation and examples on
> http://www.orbited.org/.
Just to give an example:
http://www.orbited.org/wiki/TCPSocket has a section: "Using TCPSocket in
Orbited 0.5". This is all now incorrect as adding
<script src="http://yourdomain:8000/static/TCPSocket.js"></script>
to a page will result in a 404.
:(
Ben
Indeed, the wiki needs to be updated.
As Michael described in the announce email, a few incompatible changes
were introduced:
"""
New API:
- Include /static/Orbited.js which provides Orbited.TCPSocket
- The TCPSocket constructor takes no arguments. TCPSocket.open takes
hostname and port. (and optional isBinary)
- Binary mode no longer returns integer Arrays -- it returns strings.
These strings contain all of the binary data that the arrays used to.
"""
To see how this works, have a look at the bundled demos; eg, see the
telnet demo at:
http://js.io/trac/browser/trunk/protocols/telnet/telnet.js
http://js.io/trac/browser/trunk/demos/telnet/index.html
http://js.io/trac/browser/trunk/demos/telnet/telnet-gui.js
Best regards,
Rui Lopes
Rui Lopes wrote:
> As Michael described in the announce email, a few incompatible changes
> were introduced:
>
> """
> New API:
> - Include /static/Orbited.js which provides Orbited.TCPSocket
> - The TCPSocket constructor takes no arguments. TCPSocket.open takes
> hostname and port. (and optional isBinary)
>
OK. Yes. So I can open and close the socket whenever I want.
<snipped>
> To see how this works, have a look at the bundled demos; eg, see the
> telnet demo at:
>
> http://js.io/trac/browser/trunk/protocols/telnet/telnet.js
> http://js.io/trac/browser/trunk/demos/telnet/index.html
> http://js.io/trac/browser/trunk/demos/telnet/telnet-gui.js
>
OK, thank you.
I have to say, I do need my hand holding on configuration as I have not
read the python source code. I have, of necessity, read a lot of the
Orbited.js file...
Thanks,
Ben
Ben Weiner wrote:
[...]
>> To see how this works, have a look at the bundled demos; eg, see the
>> telnet demo at:
>>
>> http://js.io/trac/browser/trunk/protocols/telnet/telnet.js
>> http://js.io/trac/browser/trunk/demos/telnet/index.html
>> http://js.io/trac/browser/trunk/demos/telnet/telnet-gui.js
>>
>>
> OK, thank you.
>
> I have to say, I do need my hand holding on configuration as I have not
> read the python source code. I have, of necessity, read a lot of the
> Orbited.js file...
>
The configuration is described at:
http://orbited.org/wiki/Configuration
But there were a few changes with 0.6, one of them was the syntax on the
"[access]" zone; for making the telnet example work, you'll need to
change orbited.cfg by adding "* -> www.google.com:80" into the
"[access]" zone, eg:
[access]
* -> www.google.com:80
This reads as, let any client connect to www.google.com at port 80.
You can see orbited.cfg at:
http://orbited.org/browser/trunk/daemon/orbited.cfg
Best regards,
Rui Lopes
Rui Lopes wrote:
> The configuration is described at:
>> http://orbited.org/wiki/Configuration
>>
>> But there were a few changes with 0.6, one of them was the syntax on the
>> "[access]" zone; for making the telnet example work, you'll need to
>> change orbited.cfg by adding "* -> www.google.com:80" into the
>> "[access]" zone, eg:
>>
>> [access]
>> * -> www.google.com:80
>>
>> This reads as, let any client connect to www.google.com at port 80.
>>
Thanks: I'd just about started to approach a similar understanding by
reading the changesets ;-\
So, can I do:
host1:8000 -> google.com:80
host1:8000 -> google.com:81
Or is that illegal?
And (changing the subject ;-) can I do
conn = new Orbited.TCPSocket();
and then
conn.open('host1','8000');
if I want to make straight TCP connections rather than stomp, telnet,
chat, etc? Calling TCPSocket() with arguments, that worked /very/
sweetly in 0.5...
Thanks
Ben
I wrote:
> And (changing the subject ;-) can I do
>
> conn = new Orbited.TCPSocket();
>
> and then
> conn.open('host1','8000');
>
>
Woops. Not reading the config there. Rather:
conn.open('google.com','81');
Cheers,
Ben
The right hand side is the destination hostname:port (arguments passed
into the TCPSocket.open function) to which the client is allowed to open
the socket.
> And (changing the subject ;-) can I do
>
> conn = new Orbited.TCPSocket();
>
> and then
> conn.open('host1','8000');
>
> if I want to make straight TCP connections rather than stomp, telnet,
> chat, etc? Calling TCPSocket() with arguments, that worked /very/
> sweetly in 0.5...
>
Use it like (as you can see on telnet.js):
conn = new Orbited.TCPSocket();
// set the callbacks here, eg: conn.onopen = function{ alert("socket is open"); };
conn.open('google.com', 80);
Best regards,
Rui Lopes
Rui Lopes wrote:
> Just use an "*" in the left hand side (LHS) to match any client IP
> address, or use a specific IP address. I'm not sure if it lets you
> define the port number, but in the normal case, it does not make sense,
> because you cannot control which port the browser uses to access orbited.
>
Well you can specify it, but whether you *want* to ... ;-)
I found that in Orbited 0.5 I was able to specify the port number when
calling the TCPSocket.js script from /static, but with 0.6 the call that
the script makes to /tcp (gets a session ID?) did not have the port
number included. That caused me some considerable confusion but in the
end I mod-rewrite proxied the Orbited server, which is running alongside
Apache. Sledgehammer? It seemed to do the trick.
> The right hand side is the destination hostname:port (arguments passed
> into the TCPSocket.open function) to which the client is allowed to open
> the socket.
>
Excellent.
>>
>>
> Use it like (as you can see on telnet.js):
>
> conn = new Orbited.TCPSocket();
> // set the callbacks here, eg: conn.onopen = function{ alert("socket is open"); };
> conn.open('google.com', 80);
>
Ace.
Remaining problems must be of my own creation ;-)
Thanks,
Ben
Hi,
Rui Lopes wrote:
> Just use an "*" in the left hand side (LHS) to match any client IP
> address, or use a specific IP address. I'm not sure if it lets you
> define the port number, but in the normal case, it does not make sense,
> because you cannot control which port the browser uses to access orbited.
>
Well you can specify it, but whether you *want* to ... ;-)
I found that in Orbited 0.5 I was able to specify the port number when
calling the TCPSocket.js script from /static, but with 0.6 the call that
the script makes to /tcp (gets a session ID?) did not have the port
number included. That caused me some considerable confusion but in the
end I mod-rewrite proxied the Orbited server, which is running alongside
Apache. Sledgehammer? It seemed to do the trick.
Is that setting is for defining the destination port where orbited
listens, that is, the port where orbited is listening?
What is its relation to the port we define in left hand side on the
"[access]" configuration?
Eg: what is the meaning of the following configuration?
[access]
*:12345 -> localhost:7
As a note, in my original answer, I was talking about the source port
the browser uses to connect to orbited, not the port where orbited is
listening.
Best regards,
Rui Lopes
Rui Lopes wrote:
> Michael Carter wrote:
>
<snipped>
>> You can control which port the browser uses to access Orbited.
>>
>> Orbited.settings.port = 8001;
>>
>> While the proxying may work, its not going to be your most scalable bet.
>>
That's interesting to hear. I remember years ago having problems with
users who were behind firewalls that prevented http over anything other
than ports 80 and 443 and I have never since dared to rely on access to
other ports. Isn't that likely to be a problem here too?
> Is that setting is for defining the destination port where orbited
> listens, that is, the port where orbited is listening?
>
> What is its relation to the port we define in left hand side on the
> "[access]" configuration?
>
> Eg: what is the meaning of the following configuration?
>
> [access]
> *:12345 -> localhost:7
>
>
> As a note, in my original answer, I was talking about the source port
> the browser uses to connect to orbited, not the port where orbited is
> listening.
>
So to summarise the conversation, it looks to me like port configuration
is like this:
- Browser outgoing: undefined (and cannot be defined)
- Orbited incoming (the connection over http):
- defined for the browser with Orbited.settings.port and
- for the Orbited server on the left-hand side of an access directive.
- Orbited outgoing (the connection to the persistent network service,
eg TCP): defined on the right-hand side of an access directive.
Therefore you need to set ports in:
Orbited.js
orbited.cfg
Have I got this right?
Thanks,
Ben
Hi there,
Rui Lopes wrote:
> Michael Carter wrote:
>
<snipped>
>> You can control which port the browser uses to access Orbited.That's interesting to hear. I remember years ago having problems with
>>
>> Orbited.settings.port = 8001;
>>
>> While the proxying may work, its not going to be your most scalable bet.
>>
users who were behind firewalls that prevented http over anything other
than ports 80 and 443 and I have never since dared to rely on access to
other ports. Isn't that likely to be a problem here too?
> Is that setting is for defining the destination port where orbitedSo to summarise the conversation, it looks to me like port configuration
> listens, that is, the port where orbited is listening?
>
> What is its relation to the port we define in left hand side on the
> "[access]" configuration?
>
> Eg: what is the meaning of the following configuration?
>
> [access]
> *:12345 -> localhost:7
>
>
> As a note, in my original answer, I was talking about the source port
> the browser uses to connect to orbited, not the port where orbited is
> listening.
>
is like this:
- Browser outgoing: undefined (and cannot be defined)
- Orbited incoming (the connection over http):
- defined for the browser with Orbited.settings.port and
- for the Orbited server on the left-hand side of an access directive.
- Orbited outgoing (the connection to the persistent network service,
eg TCP): defined on the right-hand side of an access directive.
Therefore you need to set ports in:
Orbited.js
orbited.cfg