File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,10 +87,6 @@ export class WebServer {
8787 }
8888 server = https . createServer ( options , this . app ) ;
8989
90-
91- var _http = http . createServer ( this . app ) ;
92- _http . listen ( 80 ) ;
93-
9490 // var redirapp = express();
9591 // var _http = http.createServer(redirapp);
9692 // redirapp.get('*', function (req, res) {
Original file line number Diff line number Diff line change @@ -168,6 +168,12 @@ module openflow {
168168 }
169169 init ( ) {
170170 this . getJSON ( "/config" , async ( error : any , data : any ) => {
171+ if ( location . protocol == 'https:' && data . wshost . startsWith ( "ws://" ) ) {
172+ data . wshost = data . wshost . replace ( "ws://" , "wss://" ) ;
173+ }
174+ if ( location . protocol == 'http:' && data . wshost . startsWith ( "wss://" ) ) {
175+ data . wshost = data . wshost . replace ( "wss://" , "ws://" ) ;
176+ }
171177 console . debug ( "WebSocketClient::onopen: connecting to " + data . wshost ) ;
172178 this . _socketObject = new ReconnectingWebSocket ( data . wshost ) ;
173179 this . _socketObject . onopen = ( this . onopen ) . bind ( this ) ;
Original file line number Diff line number Diff line change 1- 0.0.163
1+ 0.0.164
You can’t perform that action at this time.
0 commit comments