Introduce overrideID option to allow multiple tunnels in parellel

This commit is contained in:
nemunaire 2022-04-30 02:41:12 +02:00
commit 7187a7d187
6 changed files with 32 additions and 30 deletions

View file

@ -57,7 +57,7 @@ func showIPs(_ httprouter.Params, body []byte) (interface{}, error) {
func GetStudentTunnelIPs(student *adlin.Student) (ips []string) {
if ts, err := student.GetActivesTunnels(); err != nil || len(ts) == 0 || ts[0].SuffixIP == 0 {
ips = append(ips, adlin.StudentIP(student.Id).String()+"1")
ips = append(ips, adlin.StudentIP(student.Id, 0).String()+"1")
} else {
for _, t := range ts {
ips = append(ips, t.GetStudentIP())