@@ -3,11 +3,9 @@ import { Meteor } from '../meteor'
33// @param url {String} URL to Meteor app, eg:
44// "/" or "madewith.meteor.com" or "https://foo.meteor.com"
55// or "ddp+sockjs://ddp--****-foo.meteor.com/sockjs"
6- // @returns {String } URL to the endpoint with the specific scheme and subPath, e.g.
7- // for scheme "http" and subPath "sockjs"
8- // "http://subdomain.meteor.com/sockjs" or "/sockjs"
9- // or "https://ddp--1234-foo.meteor.com/sockjs"
10- function translateUrl ( url , newSchemeBase , subPath ) {
6+ // @returns {String } URL to the endpoint with the given scheme, e.g. for scheme "ws"
7+ // "ws://subdomain.meteor.com/websocket" or "/websocket"
8+ function translateUrl ( url , newSchemeBase ) {
119 if ( ! newSchemeBase ) {
1210 newSchemeBase = 'http'
1311 }
@@ -52,10 +50,9 @@ function translateUrl(url, newSchemeBase, subPath) {
5250 // root. See also client_convenience.js #RationalizingRelativeDDPURLs
5351 url = Meteor . _relativeToSiteRootUrl ( url )
5452
55- if ( url . endsWith ( '/' ) ) return url + subPath
56- else return url + '/' + subPath
53+ return url
5754}
5855
5956export function toWebsocketUrl ( url ) {
60- return translateUrl ( url , 'ws' , 'websocket' )
57+ return translateUrl ( url , 'ws' )
6158}
0 commit comments