Crossbar app templates / Call for testers

#1

Hi,

I've pushed a point release of Crossbar which now includes app templates for both Python and NodeJS developers:

https://github.com/crossbario/crossbar/wiki#quick-start

If you want to help this project, please check it out and test - other feedback is welcome of course as well!

Cheers,
/Tobias

PS: The Crossbar point release also fixes a problem on Python 2.7.7/Windows (we're not guilty for the issue, but we work around anyway ..)

0 Likes

#2

Tobias,

I took a quick stab at it, had some issues. I am going to start with a completely new vm tonight. What versions do I need? I was thinking of using the Ubuntu 14.04 LTS server, 2.7.7 python, pyinotify==0.9.4, Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I was wondering about the python, will I have better luck with 2.7.6?

-greg

···

On Tuesday, June 3, 2014 12:56:13 PM UTC-5, Tobias Oberstein wrote:

Hi,

I’ve pushed a point release of Crossbar which now includes app templates
for both Python and NodeJS developers:

https://github.com/crossbario/crossbar/wiki#quick-start

If you want to help this project, please check it out and test - other
feedback is welcome of course as well!

Cheers,

/Tobias

PS: The Crossbar point release also fixes a problem on Python
2.7.7/Windows (we’re not guilty for the issue, but we work around anyway …)

0 Likes

#3

Hi Greg,

thanks for testing!

I am mostly using Ubuntu 13.10 and usually do this:

https://github.com/crossbario/crossbar/wiki/Installation-from-Source#python-linux

This runs in less than 5 mins and does not depend on or pollute
any OS Python packages.

I will try that again tomorrow with a completely fresh Ubuntu VM.

Python 2.7.7 on Linux is fine (the problem was Windows specific, and it's now worked around in Crossbar itself anyway).

Please let me know if above works for you .. we really need to get the initial experience right - frustrating people is bad;)

Thanks!
/Tobias

···

Am 05.06.2014 00:07, schrieb Greg Fausak:

Tobias,

I took a quick stab at it, had some issues. I am going to start with a
completely new vm tonight. What versions do I need? I was thinking of
using the Ubuntu 14.04 LTS server, 2.7.7 python, pyinotify==0.9.4,
Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I was wondering
about the python, will I have better luck with 2.7.6?

-greg

On Tuesday, June 3, 2014 12:56:13 PM UTC-5, Tobias Oberstein wrote:

    Hi,

    I've pushed a point release of Crossbar which now includes app
    templates
    for both Python and NodeJS developers:

    https://github.com/crossbario/crossbar/wiki#quick-start
    <https://github.com/crossbario/crossbar/wiki#quick-start>

    If you want to help this project, please check it out and test - other
    feedback is welcome of course as well!

    Cheers,
    /Tobias

    PS: The Crossbar point release also fixes a problem on Python
    2.7.7/Windows (we're not guilty for the issue, but we work around
    anyway ..)

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#4

using the Ubuntu 14.04 LTS server, 2.7.7 python, pyinotify==0.9.4,

> Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I was wondering
> about the python, will I have better luck with 2.7.6?

Forgot: 14.04 LTS is perfectly fine. It should work. I will use that exact version when testing on VM tomorrow as well.

I can't speak alot about Ubuntu's Python packages - since I am not using those. I do source builds. Less variables. But I can't see a reason Crossbar wouldn't work with those OS supplied packages as well.
Will try that also.

0 Likes

#5

I just did the install with 13.10 rom the directions. The only issue what crossbar wouldn’t install because I needed bz2. Added this:
apt-get install libbz2-dev

then the install went well. I haven’t tried any of the examples yet, will do so in the morning. thanks for the help.

-greg

···

On Wednesday, June 4, 2014 5:52:04 PM UTC-5, Tobias Oberstein wrote:

using the Ubuntu 14.04 LTS server, 2.7.7 python, pyinotify==0.9.4,

Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I was wondering

about the python, will I have better luck with 2.7.6?

Forgot: 14.04 LTS is perfectly fine. It should work. I will use that
exact version when testing on VM tomorrow as well.

I can’t speak alot about Ubuntu’s Python packages - since I am not using
those. I do source builds. Less variables. But I can’t see a reason
Crossbar wouldn’t work with those OS supplied packages as well.

Will try that also.

0 Likes

#6

OK, ran the first test. The command:
crossbar init --template hello:python --appdir hello

ran without issue after the new install. however, when I cd to hello and crossbar start I get a traceback:

2014-06-05 09:36:21-0500 [Controller 1246] Crossbar.io 0.9.4-2 starting

2014-06-05 09:36:22-0500 [Controller 1246] Running on CPython using EPollReactor reactor

2014-06-05 09:36:22-0500 [Controller 1246] Starting from node directory /home/gfausak/hello/.crossbar

2014-06-05 09:36:22-0500 [Controller 1246] Starting from local configuration ‘/home/gfausak/hello/.crossbar/config.json’

2014-06-05 09:36:22-0500 [Controller 1246] No WAMPlets detected in enviroment.

2014-06-05 09:36:22-0500 [Controller 1246] Starting Router with ID ‘worker1’ …

2014-06-05 09:36:22-0500 [Router 1255] Log opened.

2014-06-05 09:36:23-0500 [Router 1255] Running under CPython using EPollReactor reactor

2014-06-05 09:36:23-0500 [Router 1255] Traceback (most recent call last):

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py”, line 188, in

2014-06-05 09:36:23-0500 [Router 1255] run()

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py”, line 118, in run

2014-06-05 09:36:23-0500 [Router 1255] from crossbar.worker.router import RouterWorkerSession

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/site-packages/crossbar/worker/router.py”, line 44, in

2014-06-05 09:36:23-0500 [Router 1255] from crossbar.router.protocol import CrossbarWampWebSocketServerFactory, \

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/site-packages/crossbar/router/protocol.py”, line 44, in

2014-06-05 09:36:23-0500 [Router 1255] import sqlite3

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/sqlite3/init.py”, line 24, in

2014-06-05 09:36:23-0500 [Router 1255] from dbapi2 import *

2014-06-05 09:36:23-0500 [Router 1255] File “/usr/local/lib/python2.7/sqlite3/dbapi2.py”, line 27, in

2014-06-05 09:36:23-0500 [Router 1255] from _sqlite3 import *

2014-06-05 09:36:23-0500 [Router 1255] ImportError: No module named _sqlite3

I don’t use sqllite, what needs to be installed?

-g

···

On Wednesday, June 4, 2014 10:43:52 PM UTC-5, Greg Fausak wrote:

I just did the install with 13.10 rom the directions. The only issue what crossbar wouldn’t install because I needed bz2. Added this:
apt-get install libbz2-dev

then the install went well. I haven’t tried any of the examples yet, will do so in the morning. thanks for the help.

-greg

On Wednesday, June 4, 2014 5:52:04 PM UTC-5, Tobias Oberstein wrote:

using the Ubuntu 14.04 LTS server, 2.7.7 python, pyinotify==0.9.4,

Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I was wondering

about the python, will I have better luck with 2.7.6?

Forgot: 14.04 LTS is perfectly fine. It should work. I will use that
exact version when testing on VM tomorrow as well.

I can’t speak alot about Ubuntu’s Python packages - since I am not using
those. I do source builds. Less variables. But I can’t see a reason
Crossbar wouldn’t work with those OS supplied packages as well.

Will try that also.

0 Likes

#7

Hi Greg,

I am right now also trying VM with Ubuntu 14.04 .. not quite through.

pls try:

sudo apt-get install libsqlite3-dev

I hope this works even when installed _after_ building Python ..

Will report again in a moment ..

Tobias

···

Am 05.06.2014 16:45, schrieb Greg Fausak:

OK, ran the first test. The command:
crossbar init --template hello:python --appdir hello

ran without issue after the new install. however, when I cd to hello
and crossbar start I get a traceback:

2014-06-05 09:36:21-0500 [Controller 1246] Crossbar.io 0.9.4-2 starting
2014-06-05 09:36:22-0500 [Controller 1246] Running on CPython using
EPollReactor reactor
2014-06-05 09:36:22-0500 [Controller 1246] Starting from node
directory /home/gfausak/hello/.crossbar
2014-06-05 09:36:22-0500 [Controller 1246] Starting from local
configuration '/home/gfausak/hello/.crossbar/config.json'
2014-06-05 09:36:22-0500 [Controller 1246] No WAMPlets detected in
enviroment.
2014-06-05 09:36:22-0500 [Controller 1246] Starting Router with ID
'worker1' ..
2014-06-05 09:36:22-0500 [Router 1255] Log opened.
2014-06-05 09:36:23-0500 [Router 1255] Running under CPython using
EPollReactor reactor
2014-06-05 09:36:23-0500 [Router 1255] Traceback (most recent call
last):
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py",
line 188, in <module>
2014-06-05 09:36:23-0500 [Router 1255] run()
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py",
line 118, in run
2014-06-05 09:36:23-0500 [Router 1255] from crossbar.worker.router
import RouterWorkerSession
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/router.py", line
44, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from
crossbar.router.protocol import CrossbarWampWebSocketServerFactory, \
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/router/protocol.py",
line 44, in <module>
2014-06-05 09:36:23-0500 [Router 1255] import sqlite3
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from dbapi2 import *
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from _sqlite3 import *
2014-06-05 09:36:23-0500 [Router 1255] ImportError: No module
named _sqlite3

I don't use sqllite, what needs to be installed?

-g

On Wednesday, June 4, 2014 10:43:52 PM UTC-5, Greg Fausak wrote:

    I just did the install with 13.10 rom the directions. The only
    issue what crossbar wouldn't install because I needed bz2. Added this:
    *apt-get install libbz2-dev*
    then the install went well. I haven't tried any of the examples
    yet, will do so in the morning. thanks for the help.
    -greg

    On Wednesday, June 4, 2014 5:52:04 PM UTC-5, Tobias Oberstein wrote:

         > using the Ubuntu 14.04 LTS server, 2.7.7 python,
        pyinotify==0.9.4,
          > Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I
        was wondering
          > about the python, will I have better luck with 2.7.6?

        Forgot: 14.04 LTS is perfectly fine. It should work. I will use
        that
        exact version when testing on VM tomorrow as well.

        I can't speak alot about Ubuntu's Python packages - since I am
        not using
        those. I do source builds. Less variables. But I can't see a reason
        Crossbar wouldn't work with those OS supplied packages as well.
        Will try that also.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#8

Hi Greg,

alright, this works for me on completely fresh 14.04 LTS:

https://github.com/crossbario/crossbar/wiki/Installation-from-Source#python-linux

When starting, and opening the demo web page like

http://192.168.1.113:8080

there is an issue, since the WebSocket URL in the demo JavaScript is hardcoded to 127.0.0.1:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L11

;(

I need to fix that. For now, when you edit

vi hello/hello/web/index.html

and fix the URL, it'll work.

Thanks for testing!

/Tobias

···

Am 05.06.2014 16:49, schrieb Tobias Oberstein:

Hi Greg,

I am right now also trying VM with Ubuntu 14.04 .. not quite through.

pls try:

sudo apt-get install libsqlite3-dev

I hope this works even when installed _after_ building Python ..

Will report again in a moment ..

Tobias

Am 05.06.2014 16:45, schrieb Greg Fausak:

OK, ran the first test. The command:
crossbar init --template hello:python --appdir hello

ran without issue after the new install. however, when I cd to hello
and crossbar start I get a traceback:

2014-06-05 09:36:21-0500 [Controller 1246] Crossbar.io 0.9.4-2 starting
2014-06-05 09:36:22-0500 [Controller 1246] Running on CPython using
EPollReactor reactor
2014-06-05 09:36:22-0500 [Controller 1246] Starting from node
directory /home/gfausak/hello/.crossbar
2014-06-05 09:36:22-0500 [Controller 1246] Starting from local
configuration '/home/gfausak/hello/.crossbar/config.json'
2014-06-05 09:36:22-0500 [Controller 1246] No WAMPlets detected in
enviroment.
2014-06-05 09:36:22-0500 [Controller 1246] Starting Router with ID
'worker1' ..
2014-06-05 09:36:22-0500 [Router 1255] Log opened.
2014-06-05 09:36:23-0500 [Router 1255] Running under CPython using
EPollReactor reactor
2014-06-05 09:36:23-0500 [Router 1255] Traceback (most recent call
last):
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py",
line 188, in <module>
2014-06-05 09:36:23-0500 [Router 1255] run()
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py",
line 118, in run
2014-06-05 09:36:23-0500 [Router 1255] from crossbar.worker.router
import RouterWorkerSession
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/worker/router.py", line
44, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from
crossbar.router.protocol import CrossbarWampWebSocketServerFactory, \
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/site-packages/crossbar/router/protocol.py",
line 44, in <module>
2014-06-05 09:36:23-0500 [Router 1255] import sqlite3
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from dbapi2 import *
2014-06-05 09:36:23-0500 [Router 1255] File
"/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
2014-06-05 09:36:23-0500 [Router 1255] from _sqlite3 import *
2014-06-05 09:36:23-0500 [Router 1255] ImportError: No module
named _sqlite3

I don't use sqllite, what needs to be installed?

-g

On Wednesday, June 4, 2014 10:43:52 PM UTC-5, Greg Fausak wrote:

    I just did the install with 13.10 rom the directions. The only
    issue what crossbar wouldn't install because I needed bz2. Added
this:
    *apt-get install libbz2-dev*
    then the install went well. I haven't tried any of the examples
    yet, will do so in the morning. thanks for the help.
    -greg

    On Wednesday, June 4, 2014 5:52:04 PM UTC-5, Tobias Oberstein wrote:

         > using the Ubuntu 14.04 LTS server, 2.7.7 python,
        pyinotify==0.9.4,
          > Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9. I
        was wondering
          > about the python, will I have better luck with 2.7.6?

        Forgot: 14.04 LTS is perfectly fine. It should work. I will use
        that
        exact version when testing on VM tomorrow as well.

        I can't speak alot about Ubuntu's Python packages - since I am
        not using
        those. I do source builds. Less variables. But I can't see a
reason
        Crossbar wouldn't work with those OS supplied packages as well.
        Will try that also.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#9

right, i did that, then rebuilt python, the demo now works !! mostly cockpit error with the python build. Even though it runs, and I can connect (I am not connecting to localhost, my demo is running on 192.168.56.101:8080, when I connect from the vmhost I see this message:

hello

Open JavaScript console to watch output.

but, when I look at the javascript console I see:

AutobahnJS debug enabled autobahn.min.js:6

[“unreachable”, Object]

  1. 0: “unreachable”
  2. 1: Object
  3. callee: function () {
  4. length: 2
  5. proto: Object

Connection lost (index):30

-g

···

On Thursday, June 5, 2014 9:49:57 AM UTC-5, Tobias Oberstein wrote:

Hi Greg,

I am right now also trying VM with Ubuntu 14.04 … not quite through.

pls try:

sudo apt-get install libsqlite3-dev

I hope this works even when installed after building Python …

Will report again in a moment …

Tobias

Am 05.06.2014 16:45, schrieb Greg Fausak:

OK, ran the first test. The command:

crossbar init --template hello:python --appdir hello

ran without issue after the new install. however, when I cd to hello

and crossbar start I get a traceback:

2014-06-05 09:36:21-0500 [Controller 1246] Crossbar.io 0.9.4-2 starting

2014-06-05 09:36:22-0500 [Controller 1246] Running on CPython using

EPollReactor reactor

2014-06-05 09:36:22-0500 [Controller 1246] Starting from node

directory /home/gfausak/hello/.crossbar

2014-06-05 09:36:22-0500 [Controller 1246] Starting from local

configuration ‘/home/gfausak/hello/.crossbar/config.json’

2014-06-05 09:36:22-0500 [Controller 1246] No WAMPlets detected in

enviroment.

2014-06-05 09:36:22-0500 [Controller 1246] Starting Router with ID

‘worker1’ …

2014-06-05 09:36:22-0500 [Router 1255] Log opened.

2014-06-05 09:36:23-0500 [Router 1255] Running under CPython using

EPollReactor reactor

2014-06-05 09:36:23-0500 [Router 1255] Traceback (most recent call

last):

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py”,

line 188, in

2014-06-05 09:36:23-0500 [Router 1255] run()

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/site-packages/crossbar/worker/process.py”,

line 118, in run

2014-06-05 09:36:23-0500 [Router 1255] from crossbar.worker.router

import RouterWorkerSession

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/site-packages/crossbar/worker/router.py”, line

44, in

2014-06-05 09:36:23-0500 [Router 1255] from

crossbar.router.protocol import CrossbarWampWebSocketServerFactory, \

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/site-packages/crossbar/router/protocol.py”,

line 44, in

2014-06-05 09:36:23-0500 [Router 1255] import sqlite3

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/sqlite3/init.py”, line 24, in

2014-06-05 09:36:23-0500 [Router 1255] from dbapi2 import *

2014-06-05 09:36:23-0500 [Router 1255] File

“/usr/local/lib/python2.7/sqlite3/dbapi2.py”, line 27, in

2014-06-05 09:36:23-0500 [Router 1255] from _sqlite3 import *

2014-06-05 09:36:23-0500 [Router 1255] ImportError: No module

named _sqlite3

I don’t use sqllite, what needs to be installed?

-g

On Wednesday, June 4, 2014 10:43:52 PM UTC-5, Greg Fausak wrote:

I just did the install with 13.10 rom the directions.  The only
issue what crossbar wouldn't install because I needed bz2. Added this:
*apt-get install libbz2-dev*
then the install went well.  I haven't tried any of the examples
yet, will do so in the morning.  thanks for the help.
-greg
On Wednesday, June 4, 2014 5:52:04 PM UTC-5, Tobias Oberstein wrote:
     > using the Ubuntu 14.04 LTS server, 2.7.7 python,
    pyinotify==0.9.4,
      > Twisted==14.0.0, Twisted-Core==13.2.0, autobahn==0.8.9.  I
    was wondering
      > about the python, will I have better luck with 2.7.6?
    Forgot: 14.04 LTS is perfectly fine. It should work. I will use
    that
    exact version when testing on VM tomorrow as well.
    I can't speak alot about Ubuntu's Python packages - since I am
    not using
    those. I do source builds. Less variables. But I can't see a reason
    Crossbar wouldn't work with those OS supplied packages as well.
    Will try that also.

0 Likes

#10

Yep: https://github.com/crossbario/crossbar/issues/62

For now:

vi hello/hello/web/index.html

and replace "127.0.0.1" with "192.168.56.101"

···

Am 05.06.2014 17:02, schrieb Greg Fausak:

right, i did that, then rebuilt python, the demo now works !! mostly
cockpit error with the python build. Even though it runs, and I can
connect (I am not connecting to localhost, my demo is running on
192.168.56.101:8080, when I connect from the vmhost I see this message:

0 Likes

#11

How do you take updates?

var parser = document.createElement(‘a’);

console.log("parser is ", parser);

parser.href = window.location;

var wsuri = ‘ws://’ + parser.hostname + ‘:8080/ws’;

var connection = new autobahn.Connection({

// url: “ws://192.168.56.101:8080/ws”,

url: wsuri,

realm: “realm1”

});

that fixes it. I am just a beginner at javascript/angular, so there is probably a better way. I can connect from two different ip addresses to the same demo with this construct. (my vm is on 192.168.56.101 which is a virtual network, and 192.168.14.20 which is a lan).

-g

···

On Thursday, June 5, 2014 10:09:43 AM UTC-5, Tobias Oberstein wrote:

Am 05.06.2014 17:02, schrieb Greg Fausak:

right, i did that, then rebuilt python, the demo now works !! mostly

cockpit error with the python build. Even though it runs, and I can

connect (I am not connecting to localhost, my demo is running on

192.168.56.101:8080, when I connect from the vmhost I see this message:

Yep: https://github.com/crossbario/crossbar/issues/62

For now:

vi hello/hello/web/index.html

and replace “127.0.0.1” with “192.168.56.101”

0 Likes

#12

Hi Greg,

a common way to do this is:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10

It'll work unless you change the path on which Crossbar serves WAMP (the "/ws") in the config:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42

And it'll still work when you open the HTML file locally (if Crossbar runs on the same host as the browser).

Thanks so much for taking the pain of going through all this;)

We need more battle field testing ..

/Tobias

···

Am 05.06.2014 17:36, schrieb Greg Fausak:

How do you take updates?

          var parser = document.createElement('a');
          console.log("parser is ", parser);
          parser.href = window.location;
          var wsuri = 'ws://' + parser.hostname + ':8080/ws';
          var connection = new autobahn.Connection({
             // url: "ws://192.168.56.101:8080/ws",
             url: wsuri,
             realm: "realm1"
          });

that fixes it. I am just a beginner at javascript/angular, so there is
probably a better way. I can connect from two different ip addresses to
the same demo with this construct. (my vm is on 192.168.56.101 which is
a virtual network, and 192.168.14.20 which is a lan).

-g

On Thursday, June 5, 2014 10:09:43 AM UTC-5, Tobias Oberstein wrote:

    Am 05.06.2014 17:02, schrieb Greg Fausak:
     > right, i did that, then rebuilt python, the demo now works !! mostly
     > cockpit error with the python build. Even though it runs, and I can
     > connect (I am not connecting to localhost, my demo is running on
     > 192.168.56.101:8080 <http://192.168.56.101:8080>, when I connect
    from the vmhost I see this message:

    Yep: https://github.com/crossbario/crossbar/issues/62
    <https://github.com/crossbario/crossbar/issues/62>

    For now:

    vi hello/hello/web/index.html

    and replace "127.0.0.1" with "192.168.56.101"

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#13

Thanks, much better :slight_smile: that works when I put it in the index.html file.

However, being pedantic, I tried to overwrite the installation in
/usr/local/lib/python2.7/site-packages/crossbar/templates/hello/python/appname/web

filename index.html. When I do that, and try to run the demo generation, I get:

root@ubuntu13-10:/home/gfausak# crossbar init --template hello:python --appdir hello

Crossbar.io application directory ‘hello’ created

Initializing application template ‘hello:python’

Creating directory /home/gfausak/hello/hello

Creating directory /home/gfausak/hello/.crossbar

Creating file /home/gfausak/hello/setup.pyo

Error encountered (‘utf8’ codec can’t decode byte 0xf3 in position 1: invalid continuation byte) - rolling back

Removing directory /home/gfausak/hello/.crossbar

Removing directory /home/gfausak/hello/hello

Traceback (most recent call last):

File “/usr/local/bin/crossbar”, line 9, in

load_entry_point(‘crossbar==0.9.4-2’, ‘console_scripts’, ‘crossbar’)()

File “/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py”, line 366, in run

options.func(options)

File “/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py”, line 141, in run_command_init

templates.init(options.appdir, options.template)

File “/usr/local/lib/python2.7/site-packages/crossbar/controller/template.py”, line 159, in init

raise e

UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xf3 in position 1: invalid continuation byte

so, do I have to reinstall the crossbar application from git somehow to incorporate changes like that? Where is that coming from? There isn’t any 0xf3 in the index.html file.

-g

···

On Thursday, June 5, 2014 10:56:13 AM UTC-5, Tobias Oberstein wrote:

Hi Greg,

a common way to do this is:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10

It’ll work unless you change the path on which Crossbar serves WAMP (the
“/ws”) in the config:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42

And it’ll still work when you open the HTML file locally (if Crossbar
runs on the same host as the browser).

Thanks so much for taking the pain of going through all this;)

We need more battle field testing …

/Tobias

Am 05.06.2014 17:36, schrieb Greg Fausak:

How do you take updates?

      var parser = document.createElement('a');
      console.log("parser is ", parser);
      parser.href = window.location;
      var wsuri = 'ws://' + parser.hostname + ':8080/ws';
      var connection = new autobahn.Connection({
         // url: "ws://[192.168.56.101:8080/ws](http://192.168.56.101:8080/ws)",
         url: wsuri,
         realm: "realm1"
      });

that fixes it. I am just a beginner at javascript/angular, so there is

probably a better way. I can connect from two different ip addresses to

the same demo with this construct. (my vm is on 192.168.56.101 which is

a virtual network, and 192.168.14.20 which is a lan).

-g

On Thursday, June 5, 2014 10:09:43 AM UTC-5, Tobias Oberstein wrote:

Am 05.06.2014 17:02, schrieb Greg Fausak:
 > right, i did that, then rebuilt python, the demo now works !! mostly
 > cockpit error with the python build.  Even though it runs, and I can
 > connect (I am not connecting to localhost, my demo is running on
 > [192.168.56.101:8080](http://192.168.56.101:8080) <[http://192.168.56.101:8080](http://192.168.56.101:8080)>, when I connect
from the vmhost I see this message:
Yep: [https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)
<[https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)>
For now:
vi hello/hello/web/index.html
and replace "127.0.0.1" with "192.168.56.101"

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

0 Likes

#14

Thanks, much better :slight_smile: that works when I put it in the index.html file.

However, being pedantic, I tried to overwrite the installation in
/usr/local/lib/python2.7/site-packages/crossbar/templates/hello/python/appname/web

filename index.html. When I do that, and try to run the demo
generation, I get:

It's likely an issue of the editor used messing things up. Let me fix another small thing and I push a new Crossbar version to PyPi.

If you want to follow the bleeding edge / trunk on GitHub or hack yourself, thats easy now also:

sudo apt-get install git

cd $HOME
git clone git@github.com:crossbario/crossbar.git
cd crossbar/crossbar
python setup.py install

later, new stuff on GitHub:

git pull
python setup.py install

Thats it. You have the Crossbar deps already installed, so above will just work.

···

Am 05.06.2014 18:19, schrieb Greg Fausak:

root@ubuntu13-10:/home/gfausak# crossbar init --template hello:python
--appdir hello
Crossbar.io application directory 'hello' created
Initializing application template 'hello:python'
Creating directory /home/gfausak/hello/hello
Creating directory /home/gfausak/hello/.crossbar
Creating file /home/gfausak/hello/setup.pyo
Error encountered ('utf8' codec can't decode byte 0xf3 in position 1:
invalid continuation byte) - rolling back
Removing directory /home/gfausak/hello/.crossbar
Removing directory /home/gfausak/hello/hello
Traceback (most recent call last):
   File "/usr/local/bin/crossbar", line 9, in <module>
     load_entry_point('crossbar==0.9.4-2', 'console_scripts', 'crossbar')()
   File
"/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py",
line 366, in run
     options.func(options)
   File
"/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py",
line 141, in run_command_init
     templates.init(options.appdir, options.template)
   File
"/usr/local/lib/python2.7/site-packages/crossbar/controller/template.py", line
159, in init
     raise e
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 1:
invalid continuation byte

so, do I have to reinstall the crossbar application from git somehow to
incorporate changes like that? Where is that coming from? There isn't
any 0xf3 in the index.html file.

-g

On Thursday, June 5, 2014 10:56:13 AM UTC-5, Tobias Oberstein wrote:

    Hi Greg,

    a common way to do this is:

    https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10
    <https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10>

    It'll work unless you change the path on which Crossbar serves WAMP
    (the
    "/ws") in the config:

    https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42
    <https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42>

    And it'll still work when you open the HTML file locally (if Crossbar
    runs on the same host as the browser).

    Thanks so much for taking the pain of going through all this;)

    We need more battle field testing ..

    /Tobias

    Am 05.06.2014 17:36, schrieb Greg Fausak:
     > How do you take updates?
     >
     > var parser = document.createElement('a');
     > console.log("parser is ", parser);
     > parser.href = window.location;
     > var wsuri = 'ws://' + parser.hostname + ':8080/ws';
     > var connection = new autobahn.Connection({
     > // url: "ws://192.168.56.101:8080/ws
    <http://192.168.56.101:8080/ws>",
     > url: wsuri,
     > realm: "realm1"
     > });
     >
     > that fixes it. I am just a beginner at javascript/angular, so
    there is
     > probably a better way. I can connect from two different ip
    addresses to
     > the same demo with this construct. (my vm is on 192.168.56.101
    which is
     > a virtual network, and 192.168.14.20 which is a lan).
     >
     > -g
     >
     > On Thursday, June 5, 2014 10:09:43 AM UTC-5, Tobias Oberstein wrote:
     >
     > Am 05.06.2014 17:02, schrieb Greg Fausak:
     > > right, i did that, then rebuilt python, the demo now works
    !! mostly
     > > cockpit error with the python build. Even though it runs,
    and I can
     > > connect (I am not connecting to localhost, my demo is
    running on
     > > 192.168.56.101:8080 <http://192.168.56.101:8080>
    <http://192.168.56.101:8080>, when I connect
     > from the vmhost I see this message:
     >
     > Yep: https://github.com/crossbario/crossbar/issues/62
    <https://github.com/crossbario/crossbar/issues/62>
     > <https://github.com/crossbario/crossbar/issues/62
    <https://github.com/crossbario/crossbar/issues/62>>
     >
     > For now:
     >
     > vi hello/hello/web/index.html
     >
     > and replace "127.0.0.1" with "192.168.56.101"
     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Autobahn" group.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#15

ya, that worked doing the pull/setup.py

It’s weird though, i was using vi, i got the complaint during the hello generation. i went and od -x on the index.html file template and grepped that for f3, nothing. in fact, on the reinstalled version i diffed the file i downloaded (your source) from the setup.py installed version, they are identical. so, i don’t get it. Anyway, so far so good.

-g

···

On Thursday, June 5, 2014 11:27:41 AM UTC-5, Tobias Oberstein wrote:

Am 05.06.2014 18:19, schrieb Greg Fausak:

Thanks, much better :slight_smile: that works when I put it in the index.html file.

However, being pedantic, I tried to overwrite the installation in

/usr/local/lib/python2.7/site-packages/crossbar/templates/hello/python/appname/web

filename index.html. When I do that, and try to run the demo

generation, I get:

It’s likely an issue of the editor used messing things up. Let me fix
another small thing and I push a new Crossbar version to PyPi.

If you want to follow the bleeding edge / trunk on GitHub or hack
yourself, thats easy now also:

sudo apt-get install git

cd $HOME

git clone git@github.com:crossbario/crossbar.git

cd crossbar/crossbar

python setup.py install

later, new stuff on GitHub:

git pull

python setup.py install

Thats it. You have the Crossbar deps already installed, so above will
just work.

root@ubuntu13-10:/home/gfausak# crossbar init --template hello:python

–appdir hello

Crossbar.io application directory ‘hello’ created

Initializing application template ‘hello:python’

Creating directory /home/gfausak/hello/hello

Creating directory /home/gfausak/hello/.crossbar

Creating file /home/gfausak/hello/setup.pyo

Error encountered (‘utf8’ codec can’t decode byte 0xf3 in position 1:

invalid continuation byte) - rolling back

Removing directory /home/gfausak/hello/.crossbar

Removing directory /home/gfausak/hello/hello

Traceback (most recent call last):

File “/usr/local/bin/crossbar”, line 9, in

 load_entry_point('crossbar==0.9.4-2', 'console_scripts', 'crossbar')()

File

“/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py”,

line 366, in run

 options.func(options)

File

“/usr/local/lib/python2.7/site-packages/crossbar/controller/cli.py”,

line 141, in run_command_init

 templates.init(options.appdir, options.template)

File

“/usr/local/lib/python2.7/site-packages/crossbar/controller/template.py”, line

159, in init

 raise e

UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xf3 in position 1:

invalid continuation byte

so, do I have to reinstall the crossbar application from git somehow to

incorporate changes like that? Where is that coming from? There isn’t

any 0xf3 in the index.html file.

-g

On Thursday, June 5, 2014 10:56:13 AM UTC-5, Tobias Oberstein wrote:

Hi Greg,
a common way to do this is:
[https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10](https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10)
<[https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10](https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10)>
It'll work unless you change the path on which Crossbar serves WAMP
(the
"/ws") in the config:
[https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42](https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42)
<[https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42](https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42)>
And it'll still work when you open the HTML file locally (if Crossbar
runs on the same host as the browser).
Thanks so much for taking the pain of going through all this;)
We need more battle field testing ..
/Tobias
Am 05.06.2014 17:36, schrieb Greg Fausak:
 > How do you take updates?
 >
 >           var parser = document.createElement('a');
 >           console.log("parser is ", parser);
 >           parser.href = window.location;
 >           var wsuri = 'ws://' + parser.hostname + ':8080/ws';
 >           var connection = new autobahn.Connection({
 >              // url: "ws://[192.168.56.101:8080/ws](http://192.168.56.101:8080/ws)
<[http://192.168.56.101:8080/ws](http://192.168.56.101:8080/ws)>",
 >              url: wsuri,
 >              realm: "realm1"
 >           });
 >
 >
 > that fixes it.  I am just a beginner at javascript/angular, so
there is
 > probably a better way.  I can connect from two different ip
addresses to
 > the same demo with this construct. (my vm is on 192.168.56.101
which is
 > a virtual network, and 192.168.14.20 which is a lan).
 >
 > -g
 >
 >
 > On Thursday, June 5, 2014 10:09:43 AM UTC-5, Tobias Oberstein wrote:
 >
 >     Am 05.06.2014 17:02, schrieb Greg Fausak:
 >      > right, i did that, then rebuilt python, the demo now works
!! mostly
 >      > cockpit error with the python build.  Even though it runs,
and I can
 >      > connect (I am not connecting to localhost, my demo is
running on
 >      > [192.168.56.101:8080](http://192.168.56.101:8080) <[http://192.168.56.101:8080](http://192.168.56.101:8080)>
<[http://192.168.56.101:8080](http://192.168.56.101:8080)>, when I connect
 >     from the vmhost I see this message:
 >
 >     Yep: [https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)
<[https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)>
 >     <[https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)
<[https://github.com/crossbario/crossbar/issues/62](https://github.com/crossbario/crossbar/issues/62)>>
 >
 >     For now:
 >
 >     vi hello/hello/web/index.html
 >
 >     and replace "127.0.0.1" with "192.168.56.101"
 >
 > --
 > You received this message because you are subscribed to the Google
 > Groups "Autobahn" group.

0 Likes

#16

That's indeed weird. vi is supposed to do the right thing. No clue.

Anyway: I pushed Crossbar 0.9.4-3 to PyPi ..

/Tobias

···

Am 05.06.2014 18:45, schrieb Greg Fausak:

ya, that worked doing the pull/setup.py

It's weird though, i was using vi, i got the complaint during the hello
generation. i went and od -x on the index.html file template and
grepped that for f3, nothing. in fact, on the reinstalled version i
diffed the file i downloaded (your source) from the setup.py installed
version, they are identical. so, i don't get it. Anyway, so far so good.

0 Likes

#17

Here’s a confirmation that the hello:python template works on Mac OSX (10.9.3) with Crossbar 0.9.4-3 running on PyPy2.3 in a virtualenv.

Yay!

···

On Thursday, June 5, 2014 7:11:06 PM UTC+2, Tobias Oberstein wrote:

Am 05.06.2014 18:45, schrieb Greg Fausak:

ya, that worked doing the pull/setup.py

It’s weird though, i was using vi, i got the complaint during the hello

generation. i went and od -x on the index.html file template and

grepped that for f3, nothing. in fact, on the reinstalled version i

diffed the file i downloaded (your source) from the setup.py installed

version, they are identical. so, i don’t get it. Anyway, so far so good.

That’s indeed weird. vi is supposed to do the right thing. No clue.

Anyway: I pushed Crossbar 0.9.4-3 to PyPi …

/Tobias

0 Likes

#18

Here's a confirmation that the hello:python template works on Mac OSX
(10.9.3) with Crossbar 0.9.4-3 running on PyPy2.3 in a virtualenv.

Yay!

Ah, good;) Thanks for testing!

/Tobias

···

Am 07.06.2014 13:35, schrieb Roger Erens:

On Thursday, June 5, 2014 7:11:06 PM UTC+2, Tobias Oberstein wrote:

    Am 05.06.2014 18:45, schrieb Greg Fausak:
     > ya, that worked doing the pull/setup.py
     >
     > It's weird though, i was using vi, i got the complaint during the
    hello
     > generation. i went and od -x on the index.html file template and
     > grepped that for f3, nothing. in fact, on the reinstalled version i
     > diffed the file i downloaded (your source) from the setup.py
    installed
     > version, they are identical. so, i don't get it. Anyway, so far
    so good.

    That's indeed weird. vi is supposed to do the right thing. No clue.

    Anyway: I pushed Crossbar 0.9.4-3 to PyPi ..

    /Tobias

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optou

0 Likes

#19

I just thought I’d follow up. I tried the connection technique calculation (wsuri calculation) below, I have a small change you might want to consider:

inline…

Hi Greg,

a common way to do this is:

https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10

in the reference, it boils down to:

wsuri = (document.location.protocol === "http:" ? "ws:" : "wss:") + "//" +

                        document.location.host + "/ws";

I had a small issue with this, I changed document.location.host to document.location.hostname, the host was appending the port number.  When I am debugging I use a variety of ports with my http connection, I don't want that port appended when I do my web socket connect.  e.g. I want a usl like:

ws://1.2.3.4:9000/

when my original http connection is:

http://1.2.3.4/

I can see that if you use the trailing /ws then maybe you probably want the original port spec.  fwiw.

> It'll work unless you change the path on which Crossbar serves WAMP (the
> "/ws") in the config:
> 
> 
> 
> [https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42](https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42)
> 
> 
> 

i think that is what you are saying here, but I missed it :-)

-g

<details class='elided'>
<summary title='Show trimmed content'>&#183;&#183;&#183;</summary>

On Thursday, June 5, 2014 10:56:13 AM UTC-5, Tobias Oberstein wrote:

> >...snip...

</details>
0 Likes

#20

Hi Greg,

I just thought I'd follow up. I tried the connection technique
calculation (wsuri calculation) below, I have a small change you might
want to consider:

inline..

    Hi Greg,

    a common way to do this is:

    https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10
    <https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/appname/web/index.html#L10>

in the reference, it boils down to:

wsuri = (document.location.protocol === "http:" ? "ws:" : "wss:") + "//" +

document.location.host+"/ws";

This code is for exactly this situation:

Both Web and WAMP run on:

- same host
- same port
- WAMP runs on path "/ws"

This is kind of default setup for Crossbar.io -- at least it is the setup used in most of the examples / docs.

I had a small issue with this, I changed document.location.host to
document.location.hostname, the host was appending the port number.

The port number is required in above situation.

  When I am debugging I use a variety of ports with my http connection,
I don't want that port appended when I do my web socket connect. e.g. I
want a usl like:

ws://1.2.3.4:9000/

when my original http connection is:

http://1.2.3.4/

Then above code does not work;)

I guess your situation is:

Web/WAMP on:
- same host
- different port

And yet another would be:

Web/WAMP on:
- different host
- different port

Besides hardcoding the WS URL or canoncial derivation (above code), another option would be:

https://github.com/crossbario/crossbar/wiki/JSON-Value-Service

You can have the WS URL of the router (and possibly other app config) served as a JSON. Get that JSON via initial Ajax request, and only then open the WS.

But this will only work if you use Crossbar.io for serving the HTML. Which I guess is exactly the thing you don't want?

I can see that if you use the trailing /ws then maybe you probably want
the original port spec. fwiw.

Exactly.

    It'll work unless you change the path on which Crossbar serves WAMP
    (the
    "/ws") in the config:

    https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42
    <https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/python/.crossbar/config.json#L42>

i think that is what you are saying here, but I missed it :slight_smile:

Kinda. No problem;)

/Tobias

···

Am 02.07.2014 17:26, schrieb Greg Fausak:

On Thursday, June 5, 2014 10:56:13 AM UTC-5, Tobias Oberstein wrote:

-g

     >...snip...

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes