Skip to content

Commit

Permalink
Update sockjs_url to latest v1
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Mar 9, 2020
1 parent dd7e642 commit 78a6aeb
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A simplified echo SockJS server could look more or less like:
var http = require('http');
var sockjs = require('sockjs');

var echo = sockjs.createServer({ sockjs_url: 'http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js' });
var echo = sockjs.createServer();
echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down Expand Up @@ -90,7 +90,7 @@ var sockjs_server = sockjs.createServer(options);
Where `options` is a hash which can contain:

<dl>
<dt>sockjs_url (string, required)</dt>
<dt>sockjs_url (string)</dt>
<dd>Transports which don't support cross-domain communication natively
('eventsource' to name one) use an iframe trick. A simple page is
served from the SockJS server (using its foreign domain) and is
Expand All @@ -99,7 +99,7 @@ Where `options` is a hash which can contain:
domain local to the SockJS server. This iframe also does need to
load SockJS javascript client library, and this option lets you specify
its url (if you're unsure, point it to
<a href="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js">
<a href="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js">
the latest minified SockJS client release</a>, this is the default).
You must explicitly specify this url on the server side for security
reasons - we don't want the possibility of running any foreign
Expand Down
2 changes: 1 addition & 1 deletion examples/echo/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<style>
.box {
width: 300px;
Expand Down
4 changes: 1 addition & 3 deletions examples/echo/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ var sockjs = require('sockjs');
var node_static = require('node-static');

// 1. Echo sockjs server
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"};

var sockjs_echo = sockjs.createServer(sockjs_opts);
var sockjs_echo = sockjs.createServer();
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down
2 changes: 1 addition & 1 deletion examples/express-3.x/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<style>
.box {
width: 300px;
Expand Down
4 changes: 1 addition & 3 deletions examples/express-3.x/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ var sockjs = require('sockjs');
var http = require('http');

// 1. Echo sockjs server
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"};

var sockjs_echo = sockjs.createServer(sockjs_opts);
var sockjs_echo = sockjs.createServer();
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down
2 changes: 1 addition & 1 deletion examples/express/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<style>
.box {
width: 300px;
Expand Down
4 changes: 1 addition & 3 deletions examples/express/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ var express = require('express');
var sockjs = require('sockjs');

// 1. Echo sockjs server
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"};

var sockjs_echo = sockjs.createServer(sockjs_opts);
var sockjs_echo = sockjs.createServer();
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down
2 changes: 1 addition & 1 deletion examples/hapi/html/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<style>
.box {
width: 300px;
Expand Down
6 changes: 1 addition & 5 deletions examples/hapi/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ var sockjs = require('sockjs');
var Hapi = require('hapi');

// 1. Echo sockjs server
var sockjs_opts = {
sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"
};

var sockjs_echo = sockjs.createServer(sockjs_opts);
var sockjs_echo = sockjs.createServer();
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down
2 changes: 1 addition & 1 deletion examples/koa/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<style>
.box {
width: 300px;
Expand Down
3 changes: 1 addition & 2 deletions examples/koa/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ var fs = require('fs');
var path = require('path');

// 1. Echo sockjs server
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"};
var sockjs_echo = sockjs.createServer(sockjs_opts);
var sockjs_echo = sockjs.createServer();
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
Expand Down
4 changes: 2 additions & 2 deletions examples/multiplex/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html><head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<script src="http://cdn.sockjs.org/websocket-multiplex-0.1.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
<script src="https://d1fxtkz8shb9d2.cloudfront.net/websocket-multiplex-0.1.js"></script>
<style>
.box {
width: 300px;
Expand Down
3 changes: 1 addition & 2 deletions examples/multiplex/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ var websocket_multiplex = require('websocket-multiplex');


// 1. Setup SockJS server
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"};
var service = sockjs.createServer(sockjs_opts);
var service = sockjs.createServer();


// 2. Setup multiplexing
Expand Down
2 changes: 1 addition & 1 deletion src/sockjs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Server extends events.EventEmitter
heartbeat_delay: 25000
disconnect_delay: 5000
log: (severity, line) -> console.log(line)
sockjs_url: 'https://cdn.jsdelivr.net/sockjs/1/sockjs.min.js'
sockjs_url: 'https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js'
if user_options
utils.objectExtend(@options, user_options)

Expand Down

0 comments on commit 78a6aeb

Please sign in to comment.