diff --git a/README.md b/README.md
index d80b572..8e330aa 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
-This repository aims to promote the development of a multi-vendor management platform for IoTs. Any device that follows the TR-369 protocol can be managed. The main objective is to facilitate and unify device management, which generates countless benefits for the end user and service providers, suppressing the demands that today's technologies require: device interconnection, data collection, speed, availability and more.
+This repository aims to promote the development of a multi-vendor management platform for CPEs and IoTs. Any device that follows the TR-369 protocol can be managed. The main objective is to facilitate and unify device management, which generates countless benefits for the end user and service providers, suppressing the demands that today's technologies require: device interconnection, data collection, speed, availability and more.
-
@@ -170,8 +170,6 @@ Currently, telecommunications giants and startups, publishing new software daily
-
-
--------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -226,7 +224,7 @@ leandro@leandro-laptop:~$ cd oktopus/backend/services/socketio && npm i && npm s
leandro@leandro-laptop:~$ cd oktopus/frontend && npm i && npm run dev
-OBS: Do not use those instructions in production. To implement the project in production you might use more resources that are already avaiable in Oktopus, but would take longer to explain in this README. Soon, there will be more help and explanations about those extra needed configs.
+
Device test agent (obuspa):
@@ -245,6 +243,16 @@ OBS: Do not use those instructions in production. To implement the project in pr
--------------------------------------------------------------------------------------------------------------------------------------------------------
+
+
+Companies that use Oktopus:
+
+
+
+If you'd like to know how to donate, start a partnership or somehow to contribute to the project, email leandro@oktopustr369.com, every contribution is welcome, and the resources will help the project to move on. Also, if your company uses this project and you'd like your logo to appear up here, contact us.
+
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+
-
Roadmap:
diff --git a/backend/services/mochi/cmd/main.go b/backend/services/mochi/cmd/main.go
index 931cb87..3383a5d 100644
--- a/backend/services/mochi/cmd/main.go
+++ b/backend/services/mochi/cmd/main.go
@@ -4,11 +4,6 @@ import (
"bytes"
"crypto/tls"
"flag"
- rv8 "github.com/go-redis/redis/v8"
- "github.com/mochi-co/mqtt/v2"
- "github.com/mochi-co/mqtt/v2/hooks/storage/redis"
- "github.com/mochi-co/mqtt/v2/packets"
- "github.com/rs/zerolog"
"io/ioutil"
"log"
"os"
@@ -16,6 +11,12 @@ import (
"strings"
"syscall"
+ rv8 "github.com/go-redis/redis/v8"
+ "github.com/mochi-co/mqtt/v2"
+ "github.com/mochi-co/mqtt/v2/hooks/storage/redis"
+ "github.com/mochi-co/mqtt/v2/packets"
+ "github.com/rs/zerolog"
+
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
@@ -145,6 +146,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
+ log.Println("Websockets is running without TLS at port " + *wsAddr)
}
if *infoAddr != "" {
diff --git a/backend/services/ws/cmd/main.go b/backend/services/ws/cmd/main.go
new file mode 100644
index 0000000..4b21c5b
--- /dev/null
+++ b/backend/services/ws/cmd/main.go
@@ -0,0 +1,9 @@
+package main
+
+import (
+ "github.com/OktopUSP/oktopus/ws/internal/ws"
+)
+
+func main() {
+ ws.StartNewServer()
+}
diff --git a/backend/services/ws/go.mod b/backend/services/ws/go.mod
new file mode 100644
index 0000000..5fdd0ba
--- /dev/null
+++ b/backend/services/ws/go.mod
@@ -0,0 +1,10 @@
+module github.com/OktopUSP/oktopus/ws
+
+go 1.21.6
+
+require (
+ github.com/gorilla/mux v1.8.1
+ github.com/gorilla/websocket v1.5.1
+)
+
+require golang.org/x/net v0.17.0 // indirect
diff --git a/backend/services/ws/go.sum b/backend/services/ws/go.sum
new file mode 100644
index 0000000..8b329b1
--- /dev/null
+++ b/backend/services/ws/go.sum
@@ -0,0 +1,6 @@
+github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
+github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
+github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
+github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
diff --git a/backend/services/ws/internal/ws/ws.go b/backend/services/ws/internal/ws/ws.go
new file mode 100644
index 0000000..bdb852a
--- /dev/null
+++ b/backend/services/ws/internal/ws/ws.go
@@ -0,0 +1,53 @@
+package ws
+
+import (
+ "log"
+ "net/http"
+
+ "github.com/gorilla/mux"
+ "github.com/gorilla/websocket"
+)
+
+var upgrader = websocket.Upgrader{
+ ReadBufferSize: 1024,
+ WriteBufferSize: 1024,
+ CheckOrigin: func(r *http.Request) bool { return true },
+}
+
+func StartNewServer() {
+ r := mux.NewRouter()
+ r.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) {
+
+ header := http.Header{
+ "Sec-Websocket-Protocol": {"v1.usp"},
+ "Sec-Websocket-Version": {"13"},
+ }
+
+ conn, err := upgrader.Upgrade(w, r, header)
+ if err != nil {
+ log.Println(err)
+ }
+ for {
+ messageType, p, err := conn.ReadMessage()
+ if err != nil {
+ log.Println(err)
+ return
+ }
+ log.Println(string(p))
+
+ if err := conn.WriteMessage(messageType, p); err != nil {
+ log.Println(err)
+ return
+ }
+
+ }
+ })
+
+ log.Println("Websockets server running")
+
+ err := http.ListenAndServe(":8080", r)
+ if err != nil {
+ log.Fatal("ListenAndServe: ", err)
+ }
+
+}