Documentation ¶
Overview ¶
Copyright 2023 Northern.tech AS
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.
Copyright 2023 Northern.tech AS
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.
Index ¶
- Constants
- Variables
- type ProxyController
- func (pc *ProxyController) CloseWsConnections()
- func (pc ProxyController) DoWsUpgrade(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func (pc *ProxyController) GetServerUrl() string
- func (pc *ProxyController) Reconfigure(menderUrl, menderJwtToken string) error
- func (pc *ProxyController) Start()
- func (pc *ProxyController) Stop()
Constants ¶
View Source
const ( ProxyHost = "127.0.0.1" InetAddrLoopback = "127.0.0.1:0" )
View Source
const ( ApiUrlDevicesPrefix = "/api/devices/" ApiUrlDevicesAuthentication = "/api/devices/v1/authentication/" ApiUrlDevicesConnect = "/api/devices/v1/deviceconnect/connect" )
Variables ¶
View Source
var (
ErrNoAuthHeader = errors.New("no authorization header")
)
Functions ¶
This section is empty.
Types ¶
type ProxyController ¶
type ProxyController struct {
// contains filtered or unexported fields
}
ProxyController proxies device API requests to Mender server
func NewProxyController ¶
func NewProxyController( client client.ApiRequester, dialer *websocket.Dialer, menderUrl, menderJwtToken string, ) (*ProxyController, error)
NewProxyController creates a new controller. If menderUrl and menderJwtToken are specified, the proxy is also started.
func (*ProxyController) CloseWsConnections ¶
func (pc *ProxyController) CloseWsConnections()
func (ProxyController) DoWsUpgrade ¶
func (*ProxyController) GetServerUrl ¶
func (pc *ProxyController) GetServerUrl() string
GetServerUrl returns the URL of the proxy
func (*ProxyController) Reconfigure ¶
func (pc *ProxyController) Reconfigure(menderUrl, menderJwtToken string) error
Reconfigure reconfigures the local proxy server
func (*ProxyController) Start ¶
func (pc *ProxyController) Start()
Start starts the local proxy server
Click to show internal directories.
Click to hide internal directories.