diff --git a/command/agent/alloc_endpoint.go b/command/agent/alloc_endpoint.go index 3fb727721369..6660227bf8d7 100644 --- a/command/agent/alloc_endpoint.go +++ b/command/agent/alloc_endpoint.go @@ -504,19 +504,7 @@ func (s *HTTPServer) allocExec(allocID string, resp http.ResponseWriter, req *ht } s.parse(resp, req, &args.QueryOptions.Region, &args.QueryOptions) - // conn, err := s.wsUpgrader.Upgrade(resp, req, nil) - // FIXME: this is an open checkOrigin here that allows :4200 to make requests to :4646, - // freeing local ember up from not having to proxy. - // This is like three workarounds in a trenchcoat and I dno't feel good about it but it unblocks me - - var upgrader = websocket.Upgrader{ - // Allow all origins - CheckOrigin: func(r *http.Request) bool { return true }, - } - - // Then when you upgrade the connection: - conn, err := upgrader.Upgrade(resp, req, nil) - + conn, err := s.wsUpgrader.Upgrade(resp, req, nil) if err != nil { return nil, fmt.Errorf("failed to upgrade connection: %v", err) } diff --git a/ui/app/services/sockets.js b/ui/app/services/sockets.js index 307e54970e1f..939d2bb9507b 100644 --- a/ui/app/services/sockets.js +++ b/ui/app/services/sockets.js @@ -36,21 +36,12 @@ export default class SocketsService extends Service { }, }); } else { - const shouldForward = config.APP.deproxyWebsockets; - const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - - // FIXME: Temporary, local ember implementation to get around websocket proxy issues duiring development. - let prefix; + const applicationAdapter = getOwner(this).lookup('adapter:application'); + const prefix = `${ + applicationAdapter.host || window.location.host + }/${applicationAdapter.urlPrefix()}`; const region = this.system.activeRegion; - if (!shouldForward) { - const applicationAdapter = getOwner(this).lookup('adapter:application'); - prefix = `${ - applicationAdapter.host || window.location.host - }/${applicationAdapter.urlPrefix()}`; - } else { - prefix = 'localhost:4646/v1'; - } return new WebSocket( `${protocol}//${prefix}/client/allocation/${taskState.allocation.id}` + diff --git a/ui/config/environment.js b/ui/config/environment.js index 26e9e2fcc72a..2be2e58ac5c2 100644 --- a/ui/config/environment.js +++ b/ui/config/environment.js @@ -55,10 +55,6 @@ module.exports = function (environment) { // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; - // FIXME: Temporary, local ember implementation - // to get around websocket proxy issues duiring development. - ENV.APP.deproxyWebsockets = true; - ENV['ember-cli-mirage'] = { enabled: USE_MIRAGE, excludeFilesFromBuild: !USE_MIRAGE,