File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ func certHandler(c *gin.Context) {
229
229
})
230
230
}
231
231
232
+ func deleteCertHandler (c * gin.Context ) {
233
+ os .Remove ("ca.cert.pem" )
234
+ os .Remove ("ca.cert.cer" )
235
+ os .Remove ("ca.key.pem" )
236
+ }
237
+
232
238
const noFirefoxTemplateHTML = `<!DOCTYPE html>
233
239
<html>
234
240
<head>
Original file line number Diff line number Diff line change 3
3
package main
4
4
5
5
import (
6
+ "net/http"
7
+ "strconv"
8
+
6
9
log "github.com/Sirupsen/logrus"
7
10
"github.com/gin-gonic/gin"
8
11
"github.com/googollee/go-socket.io"
9
- "net/http"
10
- "strconv"
11
12
)
12
13
13
14
type connection struct {
@@ -101,6 +102,7 @@ func wsHandler() *WsServer {
101
102
so .On ("command" , func (message string ) {
102
103
h .broadcast <- []byte (message )
103
104
})
105
+
104
106
so .On ("disconnection" , func () {
105
107
h .unregister <- c
106
108
})
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ func main() {
235
235
236
236
r .GET ("/" , homeHandler )
237
237
r .GET ("/certificate.crt" , certHandler )
238
+ r .DELETE ("/certificate.crt" , deleteCertHandler )
238
239
r .POST ("/upload" , uploadHandler )
239
240
r .GET ("/socket.io/" , socketHandler )
240
241
r .POST ("/socket.io/" , socketHandler )
You can’t perform that action at this time.
0 commit comments