Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
codenoid committed Jul 30, 2024
1 parent 777389b commit 74f1293
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

PHP Library for interacting with Lokal Client REST API.

```php
<?php

require __DIR__."/vendor/autoload.php";

use LokalSo\Lokal;

$address = "127.0.0.1:8080";

$lokal = new Lokal();
$tunnel = $lokal->newTunnel()
->setName("laravel test")
->setTunnelType(Lokal::TunnelTypeHTTP)
->setLANAddress("laravel-backend.local")
->setLocalAddress($address)
->showStartupBanner()
->ignoreDuplicate();

$ret = $tunnel->create();
```

# Install

```sh
Expand Down
19 changes: 0 additions & 19 deletions README.txt

This file was deleted.

10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"name": "lokal-so/lokal-php",
"description": "PHP Library for interacting with Lokal Client REST API",
"type": "library",
"keywords": [
"tunnel",
"tunneling",
"networking"
],
"homepage": "https://lokal.so/",
"license": "GPL-2.0-only",
"autoload": {
"psr-4": {
Expand All @@ -12,6 +18,10 @@
{
"name": "Ammar Faizi",
"email": "[email protected]"
},
{
"name": "Rubi Jihantoro",
"email": "[email protected]"
}
],
"require": {
Expand Down
2 changes: 1 addition & 1 deletion src/LokalSo/Lokal.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function curl(string $method, string $path, array $opt = [], array $hdr =
CURLOPT_URL => $this->base_url . $path,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_USERAGENT => "Lokal Go - github.com/lokal-so/lokal-go",
CURLOPT_USERAGENT => "Lokal PHP - github.com/lokal-so/lokal-php",
CURLOPT_HTTPHEADER => $hdr,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HEADERFUNCTION => $hdr_chk_func
Expand Down

0 comments on commit 74f1293

Please sign in to comment.