LMS Develop
Search

λ¬Έμ μΈμ
HTTPS λ°°ν¬λ₯Ό ν΅ν΄ λͺ¨λ μλ²λ€μ SSLμ ν΅ν΄ HTTPS μμ²/μλ΅μ λ°λ κ΅¬μ‘°λ‘ λ³κ²½λκ³ μμ
β’
μ΄ μ€ PixelStreamingμ νλ μΉμκ·Έλλ§μλ²(WebRTC/Stun-Turn Server)κ° λμΌν λλ©μΈ μΈμ¦μλ₯Ό μ¬μ©νλ©΄μ νλ‘ νΈμλ μλΉμ€ λ΄μ iFrameμΌλ‘ PixelStreaming νλ©΄μ μλ² λ© νλ λΆλΆμ μ€λ₯κ° λ°μ
β’
λμΌ μ€λ¦¬μ§μ λ°λ₯Έ λ¬Έμ
β’
chrome-error://chromewebdata/:1 Refused to display 'https://metaverseacademy.site:8443/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

ν΄κ²° λ°©μ νμ
ν΄κ²° μλ
β’
보μμ μνμ¬ λ€λ₯Έ μ¬μ΄νΈμμ λ‘λν λ νμ© λ²μκ° μ§μ λμ΄ μλ€.
β’
νΈμΆνλ μ¬μ΄νΈ(A νλ‘μ νΈ)λΒ νΈμΆ λΉνλ μ¬μ΄νΈ(B νλ‘μ νΈ)μμ λ§μκ±°λΌ ν μ μλ μΌμ μλ€.
β’
νΈμΆ λΉνλ μ¬μ΄νΈ(B νλ‘μ νΈ)μμ X-Frame-Options μ€μ μ ν΄μ€λ€.
β¦
DENY:Β μλνλ μ¬μ΄νΈμ κ΄κ³μμ΄ νμ΄μ§λ₯Ό νλ μμ νμ X
β¦
SAMEORIGIN:Β νμ΄μ§λ λͺ¨λ μ‘°μ νλ μμ΄ νμ΄μ§ μ체μ λμΌν μΆμ²μΈ κ²½μ°μλ§ νμ
β’
νΈμΆλΉνλ μ
μ₯μΈ B νλ‘μ νΈμμ μλ΅ ν€λμΒ X-Frame-Optionsλ₯Ό μΈν
ν΄μ 보λ΄μ£Όμ΄μΌ νλ€.
β’
httpResponse.setHeader("X-Frame-Options", "allow-fromΒ Aνλ‘μ νΈ IPμ£Όμ:ν¬νΈλ²νΈ");
httpResponse.setHeader("X-Frame-Options", "allow-from http://localhost:8080");
Java
볡μ¬
ν΄κ²° μλμ κ²°κ³Ό
νΈμΆ λΉνλ μ
μ₯μΈ Pixel Streamingμ μλ²μμ ν€λ μΆκ° μ€μ νμ
β’
μλλ SignalingWebServerμ cirrus.jsμ λΆλΆμ΄λ€.
β’
ν΄λΉ μλ² νλ‘μ νΈλ helmetμ HTTP ν€λλ₯Ό μ€μ νμ¬ μ±μ μΌλ°μ μΈ μΉ μ·¨μ½μ μΌλ‘λΆν° 보νΈνλ λ° λμμ΄ λλ Express.js λ―Έλ€μ¨μ΄λ₯Ό μ¬μ©νκ³ μλ κ²μΌλ‘ νμ
λμλ€.
if (config.UseHTTPS) {
app.use(helmet());
app.use(hsts({
maxAge: 15552000 // 180 days in seconds
}));
//Setup http -> https redirect
console.log('Redirecting http->https');
app.use(function (req, res, next) {
if (!req.secure) {
if (req.get('Host')) {
var hostAddressParts = req.get('Host').split(':');
var hostAddress = hostAddressParts[0];
if (httpsPort != 443) {
hostAddress = `${hostAddress}:${httpsPort}`;
}
return res.redirect(['https://', hostAddress, req.originalUrl].join(''));
} else {
console.error(`unable to get host name from header. Requestor ${req.ip}, url path: '${req.originalUrl}', available headers ${JSON.stringify(req.headers)}`);
return res.status(400).send('Bad Request');
}
}
next();
});
}
JavaScript
볡μ¬
β’
μ€μ λ‘ νλΌλ―Έν°λ‘ UseHttps booleanμ λ°λ κ²μΌλ‘ 보μ HTTPS μ¬μ© μμλ§ helmet μ μ©: helmet λ―Έλ€μ¨μ΄λ config.UseHTTPS κ° true μΌ λλ§ νμ±νλκ³ μλ€.
β’
helmet μ€μ λ³κ²½μΌλ‘ helmet() νΈμΆ μμ frameguard μ΅μ
μ λͺ
μμ μΌλ‘ μ€μ νμ¬ X-Frame-Options ν€λμ λμμ λ³κ²½νκ³ μ νλ€.
1.
첫λ²μ§Έλ‘ ν΄λΉ λΆλΆμ΄ μ€μ§μ μΌλ‘ μ λ¬Έμ λ₯Ό λ°μμν€λμ§ νμΈνκΈ° μνμ¬ frameguard μ΅μ
μ체λ₯Ό λΉνμ±ν ν΄λ³Έλ€.
if (config.UseHTTPS) {
app.use(helmet({
frameguard: false // frameguard λ―Έλ€μ¨μ΄ λΉνμ±ν
}));
app.use(hsts({
maxAge: 15552000 // 180 days in seconds
}));
JavaScript
볡μ¬


β’
μ΄λ₯Ό ν΅ν΄ ν΄λΉ helmet λ―Έλ€μ¨μ΄κ° ν΄λΉ λΆλΆμ μ μ΄νκ³ μλ κ²μΌλ‘ νμ
λμλ€.
2.
μ΄ μνλ‘λ 보μμ μ·¨μ½μ μ λ°μ μν¬ μ μμΌλ―λ‘ λͺ
μμ μΌλ‘ ν΄λΉ λλ©μΈμ λν μΆμ² νμ©μΌλ‘ μ€μ½νλ₯Ό μ’νκ³ μ νλ€.
if (config.UseHTTPS) {
app.use(helmet({
frameguard: false // frameguard λ―Έλ€μ¨μ΄ λΉνμ±ν
}));
app.use((req, res, next) => {
res.setHeader(
"Content-Security-Policy",
`frame-ancestors 'self' https://metaverseacademy.site:443 https://www.metaverseacademy.site:443;`
);
next();
});
app.use(hsts({
maxAge: 15552000 // 180 days in seconds
}));
...
JavaScript
볡μ¬
μ΄λ κ² ν€λλ₯Ό μΆκ° μ€μ ν΄μ€λ€. μ΄ν λͺ¨λ°μΌλ‘λ λ¬Έμ μμ΄ μ€νλλ λͺ¨μ΅

Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin'.

















