Skip to content

Commit

Permalink
Make sure we use wss protocol in AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
pziemkowski committed Feb 26, 2024
1 parent d7e98a3 commit 78187e8
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ const IS_LOCAL_ENV = ENV.ENVIRONMENT_NAME === 'local';

export const emitter = new Emitter();

// export const subscriptionClient = createClient({
// url: ENV.SUBSCRIPTIONS_URL,
//
// lazy: true,
// connectionAckWaitTimeout: 15000,
// connectionParams: () => {
// return {};
// },
// on: {
// error: async () => {
// await auth.refreshToken();
// },
// },
// });

const httpApiLink = createUploadLink({
uri: apiURL('/graphql/'),
});
Expand Down Expand Up @@ -108,10 +93,8 @@ const splitHttpLink = split(
httpContentfulLink
);

// const wsLink = new GraphQLWsLink(subscriptionClient);

const wsLink = new WebSocketLink({
uri: `${window.location.protocol === 'https' ? 'wss' : 'ws'}://${window.location.host}/api/graphql/`,
uri: `${window.location.protocol.startsWith('https') ? 'wss' : 'ws'}://${window.location.host}/api/graphql/`,
options: {
reconnect: true,
},
Expand Down

0 comments on commit 78187e8

Please sign in to comment.