OKey
OKey

Reputation: 182

Sails.js socket.io in two tier application. How to define connection options?

Sails.js has builded socket.io support.

I'm building 2-tier application so my client works at different port than backend API (Sails).

How can I use builded socket in this scenario? How can I define connection options between my client and API for socket? Right now I just attach script tag. My client works at port 8040 and API at 1337.

<script src="http://localhost:1337/js/dependencies/sails.io.js"></script>

I'm getting error: enter image description here

Upvotes: 2

Views: 111

Answers (1)

Andi N. Dirgantara
Andi N. Dirgantara

Reputation: 2051

By this documentation, you can use io.sails.url = 'https://api.mysite.com';

Upvotes: 2

Related Questions