Skip to content

Commit

Permalink
Merge pull request #238 from WhatsApp-Proxy/GewoonJaap/add-proxy-conn…
Browse files Browse the repository at this point in the history
…ection

Add proxy connection to WhatsApp
  • Loading branch information
GewoonJaap authored Oct 30, 2024
2 parents 6c27717 + 83d1eab commit 4b25aac
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/lib/components/proxyList/connectButton.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
<script lang="ts">
import type { ProxyType } from '$lib/typeDef/proxyType';
export let proxyEntry: ProxyType;
import type { ProxyServerApi } from '$lib/typeDef/proxyApiReponse';
export let proxyEntry: ProxyServerApi;
function connectToWhatsapp() {
const url = `https://wa.me/proxy?host=${proxyEntry.ipAddress}&chatPort=${proxyEntry.proxyPort}&mediaPort=588&chatTLS=true`;
window.location.href = url;
}
</script>

<div>
<button>Connect</button>
<button on:click={connectToWhatsapp}>Connect</button>
</div>

<style>
button {
background-color: #000;
color: #fff;
background-color: #25D366;
color: #000;
border: none;
border-radius: 5px;
padding: 0.5rem 1rem;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
box-shadow: 0 4px #999;
}
button:hover {
background-color: #128C7E;
}
button:active {
box-shadow: 0 2px #666;
transform: translateY(2px);
}
</style>
1 change: 1 addition & 0 deletions src/lib/components/proxyList/proxyEntry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
{:else}
<td>Pinging...</td>
{/if}
<td><ConnectButton {proxyEntry} /></td>
</tr>

<style>
Expand Down
1 change: 1 addition & 0 deletions src/lib/typeDef/proxyApiReponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface ProxyServerApi {
createdAt: string;
updatedAt: string;
responseTime?: number;
lastChecked?: string;
}

0 comments on commit 4b25aac

Please sign in to comment.