Connection refused

#1

Hello,

I’m really clueless as to what I am doing, I have been reading all over the place initially started with PHP then socket.io then autobahn python twisted

I installed pip, installed gcc, snappy-c.h, then autobahn

I placed server.py at the root directory <- dumb? as in if you do cd at the terminal or ssh, that is where I placed it

I placed client.html in a website folder

I tried to connect, says “connection refused”, I see the blue page Autobahn 0.9.6 I am not a Web Server… when looking at my domain.com:9000

I checked active ports in SSH using netstat -lp

I don’t see ports with 9000 or 8000, is that my problem?

I’m using an OVH VPS, it’s apache2.conf Ubuntu I believe I used apt-get

What I am trying to do is create a simple chat for a website, I’m wondering if server.py and client.html are purely demonstrations or if that is the fundamental components of my future chat system?

Anyway, I would appreciate any help.

Wish I had two of these servers, pretty inexpensive

0 Likes

#2

Hi!

Autobahn>Python no longer contains a WAMP router - so if you intend to use WAMP for your chat system, then you need a WAMP router. We recommend Crossbar.io, but there are alternatives.

Specifically for a simple chat system, I recommend you take a look at this code, which when run creates this simple chat. It’s old, and I would probably write it differently if I wrote it today, but it’s working code and should show you the basic principles. Note that you need to clone the entire demo repository, not just the directory, since this relies on other resources in the repo.

Hope this puts you on the right path. Else don’t hesitate to post a follow up.

Regards,

Alex

···

Am Sonntag, 15. Februar 2015 11:08:40 UTC+1 schrieb Jacob David C. Cunningham:

Hello,

I’m really clueless as to what I am doing, I have been reading all over the place initially started with PHP then socket.io then autobahn python twisted

I installed pip, installed gcc, snappy-c.h, then autobahn

I placed server.py at the root directory <- dumb? as in if you do cd at the terminal or ssh, that is where I placed it

I placed client.html in a website folder

I tried to connect, says “connection refused”, I see the blue page Autobahn 0.9.6 I am not a Web Server… when looking at my domain.com:9000

I checked active ports in SSH using netstat -lp

I don’t see ports with 9000 or 8000, is that my problem?

I’m using an OVH VPS, it’s apache2.conf Ubuntu I believe I used apt-get

What I am trying to do is create a simple chat for a website, I’m wondering if server.py and client.html are purely demonstrations or if that is the fundamental components of my future chat system?

Anyway, I would appreciate any help.

Wish I had two of these servers, pretty inexpensive

0 Likes

#3

Thank you very much Alex for your response.

I don’t know if I need to use WAMP, from what I have read WAMP can be used for subscriptions which even that I don’t understand.

At this point my main goal is a simple live chat but multiple clients.

I’ll have to look around some more thank you for the additional resources

···

On Sunday, February 15, 2015 at 6:14:38 AM UTC-5, Alexander Gödde wrote:

Hi!

Autobahn>Python no longer contains a WAMP router - so if you intend to use WAMP for your chat system, then you need a WAMP router. We recommend Crossbar.io, but there are alternatives.

Specifically for a simple chat system, I recommend you take a look at this code, which when run creates this simple chat. It’s old, and I would probably write it differently if I wrote it today, but it’s working code and should show you the basic principles. Note that you need to clone the entire demo repository, not just the directory, since this relies on other resources in the repo.

Hope this puts you on the right path. Else don’t hesitate to post a follow up.

Regards,

Alex

Am Sonntag, 15. Februar 2015 11:08:40 UTC+1 schrieb Jacob David C. Cunningham:

Hello,

I’m really clueless as to what I am doing, I have been reading all over the place initially started with PHP then socket.io then autobahn python twisted

I installed pip, installed gcc, snappy-c.h, then autobahn

I placed server.py at the root directory <- dumb? as in if you do cd at the terminal or ssh, that is where I placed it

I placed client.html in a website folder

I tried to connect, says “connection refused”, I see the blue page Autobahn 0.9.6 I am not a Web Server… when looking at my domain.com:9000

I checked active ports in SSH using netstat -lp

I don’t see ports with 9000 or 8000, is that my problem?

I’m using an OVH VPS, it’s apache2.conf Ubuntu I believe I used apt-get

What I am trying to do is create a simple chat for a website, I’m wondering if server.py and client.html are purely demonstrations or if that is the fundamental components of my future chat system?

Anyway, I would appreciate any help.

Wish I had two of these servers, pretty inexpensive

0 Likes

#4

I don’t get this, I’m not going to use the person’s websocket echo server am I ?

I swear once I get this going I’m going to write a more straightforward guide on setting up websockets, I’ve been hunting down information

I went from PHP, to socket.io to python autobahn

I’ll get back to this, tired hehe

Thanks again for shedding light

0 Likes

#5

HI Jacob!

When starting with something like this, I find that getting the core concepts is much more important than anything else.

So, from my side:

  • For chat, you need some mechanism to easily centrally distribute messages for a chat channel/room. What you want is that a member of the room sends a chat message, and all others receive this, with you implementing as little code as possible to get there.

  • One pattern which makes this possible is Publish & Subscribe. With this, members of the chat channel/room subscribe to a channel/room specific topic, e.g. “chatroom1”. A message which is published to this topic then gets sent to all subscribers.

  • WAMP implements this pattern, and a WAMP router (like Crossbar.io) provides the infrastructure. Members subscribe & post with the WAMP router, and this handles the distribution of messages. All you need to do is some configuration (e.g. who is allowed to connect, what channels/rooms are users allowed to join) of the router. No writing code to get the pattern going.

  • WAMP additionally implements routed RPCs, i.e. any member can register a procedure (e.g. “take_a_picture_with_my _webcam.user23”) and any other member can call this. Here the WAMP router acts as the registrar, calls are made to the router, and this forwards them to the provider of the procedure, and routes the result back.

  • WebSocket is just a transport. It’s now in all current browsers (the main relevant gap is pre-4.4 Android), and it provides bi-directional low-latency persistent channels which WAMP can use. For browser clients + anything over the internet this is recommended, but there are cases where other transports are used.

  • When you use WAMP (e.g. AutobahnJS in the browser and Crossbar.io as a router) you don’t really need to set up much. Installing Crossbar.io with basic capabilities (i.e. enough to get hacking) is a three-step process even under Windows, and AutobahnJS you just include like any other JavaScript library. Then you just enter the connection information for your router in the clients, and you’r ready to go.

  • For development purposes you can even get by without installing Crossbar.io at all: We run a demo instance which is reachable at “wss://demo.crossbar.io/ws” (set the “realm” to “realm1” - you’ll see where in the code). Feel free to use this for small-scale development and testing!

Hope this helps you more on your way once you’ve rested!

Regards,

Alex

···

Am Sonntag, 15. Februar 2015 13:58:11 UTC+1 schrieb Jacob David C. Cunningham:

I don’t get this, I’m not going to use the person’s websocket echo server am I ?

I swear once I get this going I’m going to write a more straightforward guide on setting up websockets, I’ve been hunting down information

I went from PHP, to socket.io to python autobahn

I’ll get back to this, tired hehe

Thanks again for shedding light

0 Likes

#6

Thank you Alex,

For your time and explaining that.

Currently I’m after single person to person chatting, specifically like facebook, where you chat live with a single person in individual tabs

It’s probably the same

I have to get into this, I’m going to work on this today, thank you again

0 Likes

#7

I don’t understand what this sentence means:

All messaging is mediated by Tavendo WebMQ

Does that mean that when I use this code, the messages can be seen by this “Tavendo WebMQ” ?

Are they the “echo server” or am I still using my own server?

I’ll have to look at the source and try to apply it.

0 Likes

#8

Hi!

We need to be better at updating the demos. The “Tavendo WebMQ” is a reference to the predecessor to Crossbar.io (which was closed source).

What it means is:

WAMP is a routed protocol. There is no direct client-to-client communication. All messages pass through a WAMP router. The advantage of this is that each client only needs a single WAMP connection (to one to the router) irrespective of how many other clients it communicates with.

When using the demo instance of Crossbar.io, your messages pass through this. We have access to them - though practically speaking we don’t log them or ever inspect them. If this is an issue even for testing, then you should run your own Crossbar.io instance (or other WAMP router) from the start. This is simple - and what you need to do for a production version anyway. The demo router is just there to help people get started, nothing more.

Regarding an “echo server”- these are servers which echo back whatever you send them. They’re used for connection testing, and have no relevance to your chat application.

Regards,

Alex

···

Am Montag, 16. Februar 2015 01:58:58 UTC+1 schrieb Jacob David C. Cunningham:

I don’t understand what this sentence means:

All messaging is mediated by Tavendo WebMQ

Does that mean that when I use this code, the messages can be seen by this “Tavendo WebMQ” ?

Are they the “echo server” or am I still using my own server?

I’ll have to look at the source and try to apply it.

0 Likes

#9

Man, I gotta tell ya, this live chat stuff is somewhat difficult, which is no problem… I mean, anything worth doing is not easy right?

What annoys me is that I am leaving a bunch of garbage on my VPS, I recently tried to get node.js to work and I went through many tutorials to install npm and node.js, when it came time to run a simple hello_word.js program, I could not get the connection to work… possibly not listening on the right port which I tried the 88, ‘0.0.0.0’ option

Anyway, I think that when I tried with Autobahn last time, I actually got the page that said something like “this page is a webserver” or something…

I’d like to master this technology so that I can pair it with a mobile application and build my own messenger service

So I’m going to start getting into this again.

Thanks for the help in the past, I really need to get myself a cheap VPS to mess around on, so that when that VPS crashes, all of my websites don’t go down as well

0 Likes