Hook up the android kotlin code to the send js code (#860)

This commit is contained in:
Donovan Preston
2018-07-27 09:11:46 -04:00
committed by GitHub
parent 5c7b4ace9a
commit a80d007e0c
16 changed files with 317 additions and 222 deletions

View File

@@ -137,7 +137,12 @@ async function upload(
const host = window.location.hostname;
const port = window.location.port;
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = await asyncInitWebSocket(`${protocol}//${host}:${port}/api/ws`);
const endpoint =
window.location.protocol === 'file:'
? 'wss://send2.dev.lcip.org/api/ws'
: `${protocol}//${host}:${port}/api/ws`;
const ws = await asyncInitWebSocket(endpoint);
try {
const metadataHeader = arrayToB64(new Uint8Array(metadata));