File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Debug from 'debug'
33import dgram from 'dgram'
44import EventEmitter from 'events'
55import http from 'http'
6+ import https from 'https'
67import peerid from 'bittorrent-peerid'
78import series from 'run-series'
89import string2compact from 'string2compact'
@@ -140,7 +141,7 @@ class Server extends EventEmitter {
140141
141142 if ( opts . stats !== false ) {
142143 if ( ! this . http ) {
143- this . http = http . createServer ( )
144+ this . http = ( opts . ssl ? https : http ) . createServer ( opts . ssl )
144145 this . http . on ( 'error' , err => { this . _onError ( err ) } )
145146 this . http . on ( 'listening' , onListening )
146147 }
@@ -307,7 +308,7 @@ class Server extends EventEmitter {
307308
308309 debug ( 'listen (port: %o hostname: %o)' , port , hostname )
309310
310- const httpPort = isObject ( port ) ? ( port . http || 0 ) : port
311+ const httpPort = ( isObject ( port ) ? ( port . http || 0 ) : port )
311312 const udpPort = isObject ( port ) ? ( port . udp || 0 ) : port
312313
313314 // binding to :: only receives IPv4 connections if the bindv6only sysctl is set 0,
You can’t perform that action at this time.
0 commit comments