datarhei / gosrt Goto Github PK
View Code? Open in Web Editor NEWImplementation of the SRT protocol in pure Go
Home Page: https://datarhei.com
License: MIT License
Implementation of the SRT protocol in pure Go
Home Page: https://datarhei.com
License: MIT License
@ioppermann βIt is really great to have a pure-Go implementation of SRT. Thanks a lot for providing it!
It works nicely on Linux and Mac, but not on Windows.
The main reason is the calls to SetSockOptInt
. I have a branch where I fix that. Currently by disabling setting socket options in Dial on Windows, since there is no way to use File
and then File().fd()
on Windows.
I have a worse problem in that the srt.Conn
always hangs on Read() after some TS packets have been read, typically within a few seconds. Do you have any idea what could be the cause and any way of trouble-shooting it?
Hello,
Would you consider developing support for SRT bonding ?
George
Hey!
I'm trying to implement my own PubSub logic(like destroy all subscribers when a publisher disconnects, etc) and the problem is some important packages like packet.Packet
are internal and the readPacket/writePackage methods are also internal, with that I would have to copy too many files to implement my logic. It makes sense?
Thanks!
In the listener mode, it seems if the AcceptFunc returns REJECT, the same request will keep getting accepted, even though the incoming socket has gone.
The following sample code demonstrates the issue:
package main
import (
"fmt"
"time"
srt "github.com/datarhei/gosrt"
)
func main() {
conf := srt.DefaultConfig()
ln, err := srt.Listen("srt", ":6000", conf)
if err != nil {
fmt.Println("err 1", err)
return
}
for {
fmt.Println("Accepting...")
conn, mode, err := ln.Accept(func(req srt.ConnRequest) srt.ConnType {
// check connection request
fmt.Println("Got connection", req.RemoteAddr())
time.Sleep(3 * time.Second)
fmt.Println("Rejecting...")
return srt.REJECT
})
if err != nil {
fmt.Println("err 2", err)
return
}
fmt.Println("conn", conn)
if mode == srt.REJECT {
// rejected connection, ignore
continue
}
fmt.Println("mode", mode)
}
}
Reproduce procedure:
We observed the following output:
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
Rejecting...
conn <nil>
Accepting...
Got connection [::1]:65203
For example, can you have a server that writes each new stream to a .ts file, creating a new file each time based on a value in the query string plus the date?
Hi,
it looks like something is broken, there is no way to retrieve the url parameters (like the token) from the connRequest.
The server contrib example uses streamId for this but all chars after the next & are stripped.
Thanks
In an environment where it would not be save to give the srt token to the receivers, it would be great to have separate tokens for publishing and a different token to receive the content.
mode=publish,token:<shared-token>,secret-token:<secret-token>
mode=re quest,token:<shared-token>
That way a malicious receiver would not be able to stream to the same channel once the publisher disconnects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.