@@ -16,9 +16,9 @@ import (
16
16
"time"
17
17
18
18
log "github.com/Sirupsen/logrus"
19
- "github.com/itsjamie/gin-cors"
20
19
"github.com/carlescere/scheduler"
21
20
"github.com/gin-gonic/gin"
21
+ "github.com/itsjamie/gin-cors"
22
22
"github.com/kardianos/osext"
23
23
"github.com/vharitonsky/iniflags"
24
24
//"github.com/sanbornm/go-selfupdate/selfupdate" #included in update.go to change heavily
@@ -232,21 +232,21 @@ func main() {
232
232
233
233
socketHandler := wsHandler ().ServeHTTP
234
234
235
- portPlain , err := getBindPort (8990 , 9001 )
235
+ port , err := getBindPort (8990 , 9001 )
236
236
if err != nil {
237
237
panic (err )
238
238
}
239
- // All the ports p in the range 8990 <= p <= portPlain
239
+ // All the ports p in the range 8990 <= p <= port
240
240
// has already been scanned and results not free.
241
241
// Thus we can restrict the search range for portSSL
242
- // to [portPlain +1, 9001).
243
- portSSL , err := getBindPort (portPlain + 1 , 9001 )
242
+ // to [port +1, 9001).
243
+ portSSL , err := getBindPort (port + 1 , 9001 )
244
244
if err != nil {
245
245
panic (err )
246
246
}
247
247
248
248
extraOriginStr := "https://create.arduino.cc, http://create.arduino.cc, https://create-dev.arduino.cc, http://create-dev.arduino.cc, http://create-staging.arduino.cc, https://create-staging.arduino.cc"
249
- extraOriginStr += ", http://localhost:" + strconv .Itoa (portPlain ) + ", https://localhost:" + strconv .Itoa (portPlain )
249
+ extraOriginStr += ", http://localhost:" + strconv .Itoa (port ) + ", https://localhost:" + strconv .Itoa (port )
250
250
extraOriginStr += ", http://localhost:" + strconv .Itoa (portSSL ) + ", https://localhost:" + strconv .Itoa (portSSL )
251
251
252
252
r .Use (cors .Middleware (cors.Config {
@@ -280,18 +280,18 @@ func main() {
280
280
log .Printf ("Error trying to bind to port: %v, so exiting..." , err )
281
281
} else {
282
282
ip := "0.0.0.0"
283
- log .Print ("Starting server and websocket (SSL) on " + ip + "" + port )
283
+ log .Print ("Starting server and websocket (SSL) on " + ip + "" + string ( port ) )
284
284
}
285
285
}()
286
286
287
287
go func () {
288
288
289
- portStr := ":" + strconv .Itoa (portPlain )
289
+ portStr := ":" + strconv .Itoa (port )
290
290
if err := r .Run (portStr ); err != nil {
291
291
log .Printf ("Error trying to bind to port: %v, so exiting..." , err )
292
292
} else {
293
293
ip := "0.0.0.0"
294
- log .Print ("Starting server and websocket on " + ip + "" + port )
294
+ log .Print ("Starting server and websocket on " + ip + "" + string ( port ) )
295
295
}
296
296
}()
297
297
0 commit comments