Skip to content

Commit

Permalink
fix: https connect error
Browse files Browse the repository at this point in the history
  • Loading branch information
muzea committed Dec 26, 2024
1 parent 2a7e221 commit 38c63db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions example-web/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ function getCurrentPort() {
return window.location.protocol === 'https:' ? 443 : 80;
}

function getSecured() {
return window.location.protocol === 'https:' ? true : false;
}

const host = window.location.hostname;
const port = getCurrentPort();
const secured = getSecured();

export const createUserConfigForPython = (workspaceRoot: string, code: string, codeUri: string): UserConfig => {
return {
Expand All @@ -38,7 +43,7 @@ export const createUserConfigForPython = (workspaceRoot: string, code: string, c
extraParams: {
authorization: 'UserAuth',
},
secured: false,
secured: secured,
startOptions: {
onCall: (languageClient?: MonacoLanguageClient) => {
setTimeout(() => {
Expand Down Expand Up @@ -107,7 +112,7 @@ export const createUserConfigForCpp = (workspaceRoot: string, code: string, code
extraParams: {
authorization: 'UserAuth',
},
secured: false,
secured: secured,
},
clientOptions: {
documentSelector: ['cpp'],
Expand Down Expand Up @@ -187,7 +192,7 @@ export const createUserConfigForJava = (workspaceRoot: string, code: string, cod
extraParams: {
authorization: 'UserAuth',
},
secured: false,
secured: secured,
},
clientOptions: {
documentSelector: ['java'],
Expand Down

0 comments on commit 38c63db

Please sign in to comment.