├── docs ├── .nojekyll ├── CNAME ├── logo.png ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── apple-touch-icon.png ├── _sidebar.md ├── faq.md ├── config.md ├── README.md ├── nat-traversal.md ├── development.md ├── index.html ├── proxy.md └── install.md ├── .gitignore ├── ui ├── src │ ├── global.css │ ├── react-app-env.d.ts │ ├── logo.png │ ├── setupTests.ts │ ├── Video.tsx │ ├── name.ts │ ├── url.ts │ ├── Router.tsx │ ├── useRoomID.ts │ ├── useConfig.ts │ ├── index.tsx │ ├── message.ts │ ├── LoginForm.tsx │ ├── RoomManage.tsx │ ├── serviceWorker.ts │ ├── useRoom.ts │ └── Room.tsx ├── public │ ├── favicon.ico │ ├── apple-touch-icon.png │ └── index.html ├── .prettierrc ├── .gitignore ├── tsconfig.json ├── serve.go └── package.json ├── users ├── ws ├── event.go ├── event_name.go ├── event_share.go ├── once.go ├── once_test.go ├── event_hostice.go ├── event_clientice.go ├── event_hostoffer.go ├── event_stop_share.go ├── event_clientanswer.go ├── prometheus.go ├── readwrite.go ├── event_join.go ├── event_disconnected.go ├── event_create.go ├── outgoing │ └── messages.go ├── rooms.go ├── room.go └── client.go ├── hack └── packr │ └── packr.go ├── Dockerfile ├── screego.config.development ├── config ├── mode │ ├── mode_test.go │ └── mode.go ├── error.go ├── loglevel_test.go ├── loglevel.go └── config.go ├── main.go ├── logger └── logger.go ├── cmd ├── command.go ├── hash.go └── serve.go ├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── turn ├── none.go ├── portrange.go └── server.go ├── util ├── password.go └── sillyname.go ├── go.mod ├── .golangci.yml ├── server ├── server.go └── server_test.go ├── Makefile ├── README.md ├── router └── router.go ├── screego.config.example ├── auth └── auth.go ├── .goreleaser.yml └── go.sum /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | screego.net 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.idea 3 | *-packr.go 4 | /dist/ 5 | *.local 6 | -------------------------------------------------------------------------------- /ui/src/global.css: -------------------------------------------------------------------------------- 1 | #root, 2 | body, 3 | html { 4 | height: 100%; 5 | } -------------------------------------------------------------------------------- /ui/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/docs/logo.png -------------------------------------------------------------------------------- /ui/src/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/ui/src/logo.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/docs/favicon.ico -------------------------------------------------------------------------------- /users: -------------------------------------------------------------------------------- 1 | # Password: admin 2 | admin:$2a$12$kNgc2ZYAXzIL6SHY.8PHAOQ8Casi0s1bKatYoG/jupt2yV1M5K5nO 3 | -------------------------------------------------------------------------------- /ws/event.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | type Event interface { 4 | Execute(*Rooms, ClientInfo) error 5 | } 6 | -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/docs/favicon-32x32.png -------------------------------------------------------------------------------- /ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/ui/public/favicon.ico -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /ui/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arihant-jain-09/server-1/master/ui/public/apple-touch-icon.png -------------------------------------------------------------------------------- /hack/packr/packr.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/gobuffalo/packr/v2/packr2/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | COPY screego /screego 3 | EXPOSE 3478/tcp 4 | EXPOSE 3478/udp 5 | EXPOSE 5050 6 | WORKDIR "/" 7 | ENTRYPOINT [ "/screego" ] 8 | CMD ["serve"] 9 | -------------------------------------------------------------------------------- /screego.config.development: -------------------------------------------------------------------------------- 1 | SCREEGO_SECRET=secure 2 | SCREEGO_LOG_LEVEL=debug 3 | SCREEGO_CORS_ALLOWED_ORIGINS=http://localhost:3000 4 | SCREEGO_USERS_FILE=./users 5 | SCREEGO_TURN_STRICT_AUTH=false 6 | -------------------------------------------------------------------------------- /docs/_sidebar.md: -------------------------------------------------------------------------------- 1 | * [Home](/) 2 | * [Installation](install.md) 3 | * [Config](config.md) 4 | * [NAT Traversal](nat-traversal.md) 5 | * [Reverse Proxy](proxy.md) 6 | * [Development](development.md) 7 | * [FAQ](faq.md) 8 | * [GitHub](https://github.com/screego/server) 9 | -------------------------------------------------------------------------------- /ui/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /ui/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "trailingComma": "es5", 8 | "bracketSpacing": false, 9 | "jsxBracketSameLine": true, 10 | "arrowParens": "always", 11 | "parser": "typescript" 12 | } -------------------------------------------------------------------------------- /config/mode/mode_test.go: -------------------------------------------------------------------------------- 1 | package mode 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/magiconair/properties/assert" 7 | ) 8 | 9 | func TestGet(t *testing.T) { 10 | mode = Prod 11 | assert.Equal(t, Prod, Get()) 12 | } 13 | 14 | func TestSet(t *testing.T) { 15 | Set(Prod) 16 | assert.Equal(t, Prod, mode) 17 | } 18 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/screego/server/cmd" 5 | pmode "github.com/screego/server/config/mode" 6 | ) 7 | 8 | var ( 9 | version = "unknown" 10 | commitHash = "unknown" 11 | mode = pmode.Dev 12 | ) 13 | 14 | func main() { 15 | pmode.Set(mode) 16 | cmd.Run(version, commitHash) 17 | } 18 | -------------------------------------------------------------------------------- /config/mode/mode.go: -------------------------------------------------------------------------------- 1 | package mode 2 | 3 | const ( 4 | // Dev for development mode 5 | Dev = "dev" 6 | // Prod for production mode 7 | Prod = "prod" 8 | ) 9 | 10 | var mode = Dev 11 | 12 | // Set sets the new mode. 13 | func Set(newMode string) { 14 | mode = newMode 15 | } 16 | 17 | // Get returns the current mode. 18 | func Get() string { 19 | return mode 20 | } 21 | -------------------------------------------------------------------------------- /logger/logger.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "os" 5 | "time" 6 | 7 | "github.com/rs/zerolog" 8 | "github.com/rs/zerolog/log" 9 | ) 10 | 11 | // Init initializes the logger 12 | func Init(lvl zerolog.Level) { 13 | log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(lvl) 14 | log.Debug().Msg("Logger initialized") 15 | } 16 | -------------------------------------------------------------------------------- /ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /ui/src/Video.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Video = ({src, className}: {src: MediaStream; className?: string}) => { 4 | const [element, setElement] = React.useState(null); 5 | 6 | React.useEffect(() => { 7 | if (element) { 8 | element.srcObject = src; 9 | element.play(); 10 | } 11 | }, [element, src]); 12 | 13 | return