Skip to content

Commit

Permalink
rename module, add attribution and notices
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Apr 1, 2022
1 parent 7c6196c commit a61dbfe
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 31 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# build
FROM golang:1.17-alpine AS builder

RUN mkdir /app
WORKDIR /app
# ADD go.mod main.go /app/

COPY go.mod ./
COPY go.sum ./
RUN go mod download

COPY *.go ./

RUN go build -o ./udp-echo
RUN go build -o ./gw

# deploy
FROM alpine AS runner

RUN mkdir /app/
RUN mkdir /app/

WORKDIR /app
COPY --from=builder /app/udp-echo ./
COPY --from=builder /app/gw ./

CMD ["./udp-echo"]
CMD ["./gw"]
22 changes: 0 additions & 22 deletions build.log

This file was deleted.

Empty file removed f1
Empty file.
2 changes: 0 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# fly.toml file generated for withered-bird-2688 on 2022-03-09T17:58:44+05:30

app = "withered-bird-2688"

kill_signal = "SIGINT"
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/fly-aps/udp-echo
module github.com/celzero/gateway

go 1.17
go 1.18

require github.com/pires/go-proxyproto v0.6.2
24 changes: 24 additions & 0 deletions http.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
// Copyright (c) 2022 RethinkDNS and its authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This file incorporates work covered by the following copyright and
// permission notice:
//
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Adopted from: github.com/inetaf/tcpproxy/blob/be3ee21/http.go
package main

import (
Expand Down
25 changes: 25 additions & 0 deletions sni.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
// Copyright (c) 2022 RethinkDNS and its authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This file incorporates work covered by the following copyright and
// permission notice:
//
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Adopted from: github.com/inetaf/tcpproxy/blob/be3ee21/sni.go
package main

import (
Expand Down Expand Up @@ -42,5 +66,6 @@ type sniSniffConn struct {
net.Conn // nil; crash on any unexpected use
}

// ref: archive.is/SdYhp
func (c sniSniffConn) Read(p []byte) (int, error) { return c.r.Read(p) }
func (sniSniffConn) Write(p []byte) (int, error) { return 0, io.EOF }

0 comments on commit a61dbfe

Please sign in to comment.