Use different CDN for loading Pusher JS library (#20)

Use jsDelivr to increase the loading speed (when compared to MaxCDN) in China.
This commit is contained in:
Golden 2020-05-01 17:35:46 +08:00 committed by GitHub
parent 912254864c
commit 74a1ebe813

View File

@ -10,7 +10,7 @@ import Button from 'flarum/components/Button';
app.initializers.add('flarum-pusher', () => {
const loadPusher = m.deferred();
$.getScript('//js.pusher.com/3.0/pusher.min.js', () => {
$.getScript('//cdn.jsdelivr.net/npm/pusher-js@3.0.0/dist/pusher.min.js', () => {
const socket = new Pusher(app.forum.attribute('pusherKey'), {
authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',
cluster: app.forum.attribute('pusherCluster'),